From b08a47829aca5120f5cf380f5cb02374317a8c1c Mon Sep 17 00:00:00 2001 From: Ryan Levick Date: Wed, 21 Feb 2024 09:23:28 -0500 Subject: [PATCH] Rename wasm32-wasi-preview2 to wasm32-wasip2 Signed-off-by: Ryan Levick --- compiler/rustc_span/src/symbol.rs | 2 +- compiler/rustc_target/src/spec/mod.rs | 2 +- .../targets/{wasm32_wasi_preview2.rs => wasm32_wasip2.rs} | 4 ++-- library/std/src/os/mod.rs | 4 ++-- library/std/src/os/wasi/mod.rs | 4 ++-- library/std/src/os/{wasi_preview2 => wasip2}/mod.rs | 0 library/std/src/sys/pal/mod.rs | 6 +++--- library/std/src/sys/pal/{wasi_preview2 => wasip2}/mod.rs | 2 +- src/bootstrap/src/core/build_steps/compile.rs | 2 +- src/bootstrap/src/lib.rs | 2 +- src/doc/book | 2 +- src/doc/edition-guide | 2 +- src/doc/reference | 2 +- src/doc/rust-by-example | 2 +- src/doc/rustc/src/SUMMARY.md | 2 +- src/doc/rustc/src/platform-support.md | 2 +- .../{wasm32-wasi-preview2.md => wasm32-wasip2.md} | 6 +++--- tests/assembly/targets/targets-elf.rs | 2 +- 18 files changed, 24 insertions(+), 24 deletions(-) rename compiler/rustc_target/src/spec/targets/{wasm32_wasi_preview2.rs => wasm32_wasip2.rs} (96%) rename library/std/src/os/{wasi_preview2 => wasip2}/mod.rs (100%) rename library/std/src/sys/pal/{wasi_preview2 => wasip2}/mod.rs (95%) rename src/doc/rustc/src/platform-support/{wasm32-wasi-preview2.md => wasm32-wasip2.md} (88%) diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index eca80d58c562b..5f9373dd81a58 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -1881,9 +1881,9 @@ symbols! { vtable_align, vtable_size, warn, + wasip2, wasm_abi, wasm_import_module, - wasm_preview2, wasm_target_feature, while_let, windows, diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index bea03068f6da3..651d563227750 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1575,7 +1575,7 @@ supported_targets! { ("wasm32-unknown-emscripten", wasm32_unknown_emscripten), ("wasm32-unknown-unknown", wasm32_unknown_unknown), ("wasm32-wasi", wasm32_wasi), - ("wasm32-wasi-preview2", wasm32_wasi_preview2), + ("wasm32-wasip2", wasm32_wasip2), ("wasm32-wasi-preview1-threads", wasm32_wasi_preview1_threads), ("wasm64-unknown-unknown", wasm64_unknown_unknown), diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasi_preview2.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip2.rs similarity index 96% rename from compiler/rustc_target/src/spec/targets/wasm32_wasi_preview2.rs rename to compiler/rustc_target/src/spec/targets/wasm32_wasip2.rs index fc44e5d4cbce9..30f7636f0bbe5 100644 --- a/compiler/rustc_target/src/spec/targets/wasm32_wasi_preview2.rs +++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip2.rs @@ -1,4 +1,4 @@ -//! The `wasm32-wasi-preview2` target is the next evolution of the +//! The `wasm32-wasip2` target is the next evolution of the //! wasm32-wasi target. While the wasi specification is still under //! active development, the {review 2 iteration is considered an "island //! of stability" that should allow users to rely on it indefinitely. @@ -24,7 +24,7 @@ pub fn target() -> Target { let mut options = base::wasm::options(); options.os = "wasi".into(); - options.env = "preview2".into(); + options.env = "p2".into(); options.linker = Some("wasm-component-ld".into()); options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained(); diff --git a/library/std/src/os/mod.rs b/library/std/src/os/mod.rs index f03e079030503..bebf3a797d813 100644 --- a/library/std/src/os/mod.rs +++ b/library/std/src/os/mod.rs @@ -85,8 +85,8 @@ pub mod linux; #[cfg(any(target_os = "wasi", doc))] pub mod wasi; -#[cfg(any(all(target_os = "wasi", target_env = "preview2"), doc))] -pub mod wasi_preview2; +#[cfg(any(all(target_os = "wasi", target_env = "p2"), doc))] +pub mod wasip2; // windows #[cfg(not(all( diff --git a/library/std/src/os/wasi/mod.rs b/library/std/src/os/wasi/mod.rs index 05c8d30073f42..e36b93e60ea1c 100644 --- a/library/std/src/os/wasi/mod.rs +++ b/library/std/src/os/wasi/mod.rs @@ -28,8 +28,8 @@ //! [`OsStr`]: crate::ffi::OsStr //! [`OsString`]: crate::ffi::OsString -#![cfg_attr(not(target_env = "preview2"), stable(feature = "rust1", since = "1.0.0"))] -#![cfg_attr(target_env = "preview2", unstable(feature = "wasm_preview2", issue = "none"))] +#![cfg_attr(not(target_env = "p2"), stable(feature = "rust1", since = "1.0.0"))] +#![cfg_attr(target_env = "p2", unstable(feature = "wasip2", issue = "none"))] #![deny(unsafe_op_in_unsafe_fn)] #![doc(cfg(target_os = "wasi"))] diff --git a/library/std/src/os/wasi_preview2/mod.rs b/library/std/src/os/wasip2/mod.rs similarity index 100% rename from library/std/src/os/wasi_preview2/mod.rs rename to library/std/src/os/wasip2/mod.rs diff --git a/library/std/src/sys/pal/mod.rs b/library/std/src/sys/pal/mod.rs index f927d88d46c34..7c87deed3715a 100644 --- a/library/std/src/sys/pal/mod.rs +++ b/library/std/src/sys/pal/mod.rs @@ -40,9 +40,9 @@ cfg_if::cfg_if! { } else if #[cfg(target_os = "wasi")] { mod wasi; pub use self::wasi::*; - } else if #[cfg(all(target_os = "wasi", target_env = "preview2"))] { - mod wasi_preview2; - pub use self::wasi_preview2::*; + } else if #[cfg(all(target_os = "wasi", target_env = "p2"))] { + mod wasip2; + pub use self::wasip2::*; } else if #[cfg(target_family = "wasm")] { mod wasm; pub use self::wasm::*; diff --git a/library/std/src/sys/pal/wasi_preview2/mod.rs b/library/std/src/sys/pal/wasip2/mod.rs similarity index 95% rename from library/std/src/sys/pal/wasi_preview2/mod.rs rename to library/std/src/sys/pal/wasip2/mod.rs index b61695015bbd9..b12a8d5ea11c7 100644 --- a/library/std/src/sys/pal/wasi_preview2/mod.rs +++ b/library/std/src/sys/pal/wasip2/mod.rs @@ -49,7 +49,7 @@ pub mod time; cfg_if::cfg_if! { if #[cfg(target_feature = "atomics")] { - compile_error!("The wasm32-wasi-preview2 target does not support atomics"); + compile_error!("The wasm32-wasip2 target does not support atomics"); } else { #[path = "../unsupported/locks/mod.rs"] pub mod locks; diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs index 9860d56ff6ece..43ac71b112c0b 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs @@ -404,7 +404,7 @@ fn copy_self_contained_objects( ) }) .join("lib") - .join(target.to_string().replace("-preview1", "").replace("-preview2", "")); + .join(target.to_string().replace("-preview1", "").replace("p2", "")); for &obj in &["libc.a", "crt1-command.o", "crt1-reactor.o"] { copy_and_stamp( builder, diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs index 620bd8770d878..f7748621d93ba 100644 --- a/src/bootstrap/src/lib.rs +++ b/src/bootstrap/src/lib.rs @@ -89,7 +89,7 @@ const EXTRA_CHECK_CFGS: &[(Option, &str, Option<&[&'static str]>)] = &[ (Some(Mode::Std), "netbsd10", None), (Some(Mode::Std), "backtrace_in_libstd", None), /* Extra values not defined in the built-in targets yet, but used in std */ - (Some(Mode::Std), "target_env", Some(&["libnx", "preview2"])), + (Some(Mode::Std), "target_env", Some(&["libnx", "p2"])), // (Some(Mode::Std), "target_os", Some(&[])), (Some(Mode::Std), "target_arch", Some(&["spirv", "nvptx", "xtensa"])), /* Extra names used by dependencies */ diff --git a/src/doc/book b/src/doc/book index 71352deb20727..19c40bfd2d576 160000 --- a/src/doc/book +++ b/src/doc/book @@ -1 +1 @@ -Subproject commit 71352deb20727b4dda9ebfe8182709d5bf17dfea +Subproject commit 19c40bfd2d57641d962f3119a1c343355f1b3c5e diff --git a/src/doc/edition-guide b/src/doc/edition-guide index baafacc6d8701..e1eead1181a69 160000 --- a/src/doc/edition-guide +++ b/src/doc/edition-guide @@ -1 +1 @@ -Subproject commit baafacc6d8701269dab1e1e333f3547fb54b5a59 +Subproject commit e1eead1181a691e56299294d5f1d62fe7a26d317 diff --git a/src/doc/reference b/src/doc/reference index a0b119535e774..3417f866932cb 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit a0b119535e7740f68494c4f0582f7ad008b00ccd +Subproject commit 3417f866932cb1c09c6be0f31d2a02ee01b4b95d diff --git a/src/doc/rust-by-example b/src/doc/rust-by-example index 179256a445d61..57f1e708f5d58 160000 --- a/src/doc/rust-by-example +++ b/src/doc/rust-by-example @@ -1 +1 @@ -Subproject commit 179256a445d6144f5f371fdefb993f48f33978b0 +Subproject commit 57f1e708f5d5850562bc385aaf610e6af14d6ec8 diff --git a/src/doc/rustc/src/SUMMARY.md b/src/doc/rustc/src/SUMMARY.md index 3f65da65f7ad9..d4ca91977a636 100644 --- a/src/doc/rustc/src/SUMMARY.md +++ b/src/doc/rustc/src/SUMMARY.md @@ -60,7 +60,7 @@ - [*-unknown-openbsd](platform-support/openbsd.md) - [\*-unknown-uefi](platform-support/unknown-uefi.md) - [wasm32-wasi-preview1-threads](platform-support/wasm32-wasi-preview1-threads.md) - - [wasm32-wasi-preview2](platform-support/wasm32-wasi-preview2.md) + - [wasm32-wasip2](platform-support/wasm32-wasip2.md) - [wasm64-unknown-unknown](platform-support/wasm64-unknown-unknown.md) - [\*-win7-windows-msvc](platform-support/win7-windows-msvc.md) - [x86_64-fortanix-unknown-sgx](platform-support/x86_64-fortanix-unknown-sgx.md) diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index c55ba242a37d2..984cb13f790ca 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -361,7 +361,7 @@ target | std | host | notes `thumbv7a-pc-windows-msvc` | ? | | `thumbv7a-uwp-windows-msvc` | ✓ | | `thumbv7neon-unknown-linux-musleabihf` | ? | | Thumb2-mode ARMv7-A Linux with NEON, MUSL -[`wasm32-wasi-preview2`](platform-support/wasm32-wasi-preview2.md) | ✓ | | WebAssembly +[`wasm32-wasip2`](platform-support/wasm32-wasip2.md) | ✓ | | WebAssembly [`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly `x86_64-apple-ios-macabi` | ✓ | | Apple Catalyst on x86_64 [`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ? | | x86 64-bit tvOS diff --git a/src/doc/rustc/src/platform-support/wasm32-wasi-preview2.md b/src/doc/rustc/src/platform-support/wasm32-wasip2.md similarity index 88% rename from src/doc/rustc/src/platform-support/wasm32-wasi-preview2.md rename to src/doc/rustc/src/platform-support/wasm32-wasip2.md index 837efd13d417e..4466d2c084053 100644 --- a/src/doc/rustc/src/platform-support/wasm32-wasi-preview2.md +++ b/src/doc/rustc/src/platform-support/wasm32-wasip2.md @@ -1,9 +1,9 @@ -# `wasm32-wasi-preview2` +# `wasm32-wasip2` **Tier: 3** -The `wasm32-wasi-preview2` target is a new and still (as of January 2024) an -experimental target. This target is an extension to `wasm32-wasi-preview1` target, +The `wasm32-wasip2` target is a new and still (as of January 2024) an +experimental target. This target is an extension to `wasm32-wasip1` target, originally known as `wasm32-wasi`. It is the next evolution in the development of wasi (the [WebAssembly System Interface](https://wasi.dev)) that uses the WebAssembly [component model] to allow for a standardized set of syscalls that are intended to empower diff --git a/tests/assembly/targets/targets-elf.rs b/tests/assembly/targets/targets-elf.rs index e74d0b6d654fc..a741f5deb6e8c 100644 --- a/tests/assembly/targets/targets-elf.rs +++ b/tests/assembly/targets/targets-elf.rs @@ -489,7 +489,7 @@ //@ revisions: wasm32_wasi_preview1_threads //@ [wasm32_wasi_preview1_threads] compile-flags: --target wasm32-wasi-preview1-threads //@ [wasm32_wasi_preview1_threads] needs-llvm-components: webassembly -//@ revisions: wasm32_wasip1 +//@ revisions: wasm32_wasip2 //@ [wasm32_wasip2] compile-flags: --target wasm32-wasip2 //@ [wasm32_wasip2] needs-llvm-components: webassembly //@ revisions: wasm64_unknown_unknown