rust/library/std/src/os
bors ef324565d0 Auto merge of #119616 - rylev:wasm32-wasi-preview2, r=petrochenkov,m-ou-se
Add a new `wasm32-wasi-preview2` target

This is the initial implementation of the MCP https://github.com/rust-lang/compiler-team/issues/694 creating a new tier 3 target `wasm32-wasi-preview2`. That MCP has been seconded and will most likely be approved in a little over a week from now. For more information on the need for this target, please read the [MCP](https://github.com/rust-lang/compiler-team/issues/694).

There is one aspect of this PR that will become insta-stable once these changes reach a stable compiler:
* A new `target_family` named `wasi` is introduced. This target family incorporates all wasi targets including `wasm32-wasi` and its derivative `wasm32-wasi-preview1-threads`. The difference between `target_family = wasi` and `target_os = wasi` will become much clearer when `wasm32-wasi` is renamed to `wasm32-wasi-preview1` and the `target_os` becomes `wasm32-wasi-preview1`. You can read about this target rename in [this MCP](https://github.com/rust-lang/compiler-team/issues/695) which has also been seconded and will hopefully be officially approved soon.

Additional technical details include:
* Both `std::sys::wasi_preview2` and `std::os::wasi_preview2` have been created and mostly use `#[path]` annotations on their submodules to reach into the existing `wasi` (soon to be `wasi_preview1`) modules. Over time the differences between `wasi_preview1` and `wasi_preview2` will grow and most like all `#[path]` based module aliases will fall away.
* Building `wasi-preview2` relies on a [`wasi-sdk`](https://github.com/WebAssembly/wasi-sdk) in the same way that `wasi-preview1` does (one must include a `wasi-root` path in the `Config.toml` pointing to sysroot included in the wasi-sdk). The target should build against [wasi-sdk v21](https://github.com/WebAssembly/wasi-sdk/releases/tag/wasi-sdk-21) without modifications. However, the wasi-sdk itself is growing [preview2 support](https://github.com/WebAssembly/wasi-sdk/pull/370) so this might shift rapidly. We will be following along quickly to make sure that building the target remains possible as the wasi-sdk changes.
* This requires a [patch to libc](https://github.com/rylev/rust-libc/tree/wasm32-wasi-preview2) that we'll need to land in conjunction with this change. Until that patch lands the target won't actually build.
2024-02-27 20:57:38 +00:00
..
aix Support AIX in Rust standard library 2023-10-09 14:02:57 +08:00
android Add definitions for riscv64_linux_android target 2023-07-26 11:46:48 -07:00
dragonfly Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
emscripten Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
espidf Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
fd Document various I/O handle conversions 2024-02-04 12:14:53 -05:00
fortanix_sgx sync the various FromRawFd trait docs, and remove 'valid' 2023-08-14 08:49:40 +02:00
freebsd changes from feedback 2023-10-20 23:55:14 +01:00
fuchsia Add definitions for riscv64gc-unknown-fuchsia 2023-04-25 16:42:59 -07:00
haiku Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
hermit remove code duplications 2023-02-24 15:30:14 +01:00
horizon Update libc::stat field names 2022-06-13 20:44:58 -07:00
hurd added support for GNU/Hurd 2023-09-21 17:31:25 +02:00
illumos Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
ios Substitute version placeholders 2023-11-15 19:40:51 -05:00
l4re Remove asmjs from library 2023-10-28 23:10:45 -07:00
linux Finishing clone3 clean up 2024-01-24 17:23:51 +03:00
macos Substitute version placeholders 2023-11-15 19:40:51 -05:00
net os::net: expanding TcpStreamExt for Linux with tcp_deferaccept. 2024-02-21 20:59:15 +00:00
netbsd Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
nto Update library/std/src/os/nto/mod.rs 2023-03-01 06:42:40 +01:00
openbsd Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
raw Remove #[cfg(all())] workarounds from c_char 2023-06-16 12:17:12 +00:00
redox Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
solaris Remove use of #[rustc_deprecated] 2022-04-14 01:33:13 -04:00
solid kmc-solid: Re-export {As,Borrowed,Owned}Fd in std::os::solid::prelude 2023-11-08 10:52:00 +09:00
uefi Rebase to master 2023-09-22 17:23:33 +05:30
unix library: use addr_of! 2024-02-24 16:02:17 +03:00
vita PS Vita std support 2023-05-07 18:57:43 +03:00
vxworks Take sys/vxworks/{fd,fs,io} from sys/unix instead. 2020-10-16 06:19:00 +02:00
wasi Rename wasm32-wasi-preview2 to wasm32-wasip2 2024-02-27 10:14:45 -05:00
wasip2 Rename wasm32-wasi-preview2 to wasm32-wasip2 2024-02-27 10:14:45 -05:00
watchos Substitute version placeholders 2023-11-15 19:40:51 -05:00
windows Rollup merge of #120459 - rytheo:handle-conversion-docs, r=Mark-Simulacrum 2024-02-11 08:25:43 +01:00
xous std: xous: use constants for stdout and stderr 2024-01-13 09:38:42 -08:00
mod.rs Rename wasm32-wasi-preview2 to wasm32-wasip2 2024-02-27 10:14:45 -05:00