Skip to content

Commit

Permalink
Rename wasm32-wasi-preview2 to wasm32-wasip2
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Levick <me@ryanlevick.com>
  • Loading branch information
rylev committed Feb 27, 2024
1 parent f115064 commit b08a478
Show file tree
Hide file tree
Showing 18 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion compiler/rustc_span/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1881,9 +1881,9 @@ symbols! {
vtable_align,
vtable_size,
warn,
wasip2,
wasm_abi,
wasm_import_module,
wasm_preview2,
wasm_target_feature,
while_let,
windows,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/os/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions library/std/src/os/wasi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))]

Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions library/std/src/sys/pal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const EXTRA_CHECK_CFGS: &[(Option<Mode>, &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 */
Expand Down
2 changes: 1 addition & 1 deletion src/doc/book
Submodule book updated 95 files
+2 −2 .github/workflows/main.yml
+1 −0 ci/dictionary.txt
+8 −8 listings/ch02-guessing-game-tutorial/listing-02-02/Cargo.lock
+5 −5 listings/ch02-guessing-game-tutorial/listing-02-04/output.txt
+4 −0 listings/ch02-guessing-game-tutorial/no-listing-02-without-expect/output.txt
+1 −1 listings/ch03-common-programming-concepts/no-listing-01-variables-are-immutable/output.txt
+7 −1 listings/ch03-common-programming-concepts/no-listing-05-mut-cant-change-types/output.txt
+2 −17 listings/ch03-common-programming-concepts/no-listing-19-statements-vs-expressions/output.txt
+1 −1 listings/ch03-common-programming-concepts/no-listing-23-statements-dont-return-values/output.txt
+1 −1 listings/ch03-common-programming-concepts/no-listing-28-if-condition-must-be-bool/output.txt
+1 −1 listings/ch03-common-programming-concepts/no-listing-31-arms-must-return-same-type/output.txt
+7 −6 listings/ch03-common-programming-concepts/output-only-01-no-type-annotations/output.txt
+7 −4 listings/ch04-understanding-ownership/listing-04-06/output.txt
+1 −1 listings/ch04-understanding-ownership/no-listing-04-cant-use-after-move/output.txt
+1 −1 listings/ch04-understanding-ownership/no-listing-10-multiple-mut-not-allowed/output.txt
+1 −1 listings/ch04-understanding-ownership/no-listing-12-immutable-and-mutable-not-allowed/output.txt
+7 −2 listings/ch04-understanding-ownership/no-listing-14-dangling-reference/output.txt
+1 −1 listings/ch04-understanding-ownership/no-listing-19-slice-error/output.txt
+1 −1 listings/ch05-using-structs-to-structure-related-data/listing-05-11/output.txt
+1 −1 listings/ch05-using-structs-to-structure-related-data/no-listing-02-reference-in-struct/output.txt
+2 −2 listings/ch05-using-structs-to-structure-related-data/no-listing-05-dbg-macro/output.txt
+3 −2 listings/ch05-using-structs-to-structure-related-data/output-only-01-debug/output.txt
+3 −3 listings/ch06-enums-and-pattern-matching/no-listing-07-cant-use-option-directly/output.txt
+4 −4 listings/ch06-enums-and-pattern-matching/no-listing-10-non-exhaustive-match/output.txt
+7 −3 listings/ch07-managing-growing-projects/listing-07-03/output.txt
+1 −1 listings/ch07-managing-growing-projects/listing-07-05/output.txt
+12 −7 listings/ch07-managing-growing-projects/listing-07-12/output.txt
+2 −2 listings/ch08-common-collections/listing-08-06/output.txt
+6 −6 listings/ch08-common-collections/listing-08-19/output.txt
+2 −1 listings/ch08-common-collections/output-only-01-not-char-boundary/output.txt
+2 −1 listings/ch09-error-handling/listing-09-01/output.txt
+2 −1 listings/ch09-error-handling/listing-09-04/output.txt
+1 −1 listings/ch09-error-handling/listing-09-10/output.txt
+2 −1 listings/ch09-error-handling/no-listing-01-panic/output.txt
+1 −1 listings/ch10-generic-types-traits-and-lifetimes/listing-10-05/output.txt
+1 −1 listings/ch10-generic-types-traits-and-lifetimes/listing-10-07/output.txt
+3 −1 listings/ch10-generic-types-traits-and-lifetimes/listing-10-16/output.txt
+1 −1 listings/ch10-generic-types-traits-and-lifetimes/listing-10-20/output.txt
+4 −2 listings/ch10-generic-types-traits-and-lifetimes/listing-10-23/output.txt
+6 −3 listings/ch10-generic-types-traits-and-lifetimes/no-listing-09-unrelated-lifetime/output.txt
+7 −1 listings/ch11-writing-automated-tests/listing-11-01/src/lib.rs
+2 −1 listings/ch11-writing-automated-tests/listing-11-03/output.txt
+4 −3 listings/ch11-writing-automated-tests/listing-11-10/output.txt
+2 −1 listings/ch11-writing-automated-tests/no-listing-03-introducing-a-bug/output.txt
+4 −3 listings/ch11-writing-automated-tests/no-listing-04-bug-in-add-two/output.txt
+2 −1 listings/ch11-writing-automated-tests/no-listing-06-greeter-with-bug/output.txt
+2 −1 listings/ch11-writing-automated-tests/no-listing-07-custom-failure-message/output.txt
+2 −1 listings/ch11-writing-automated-tests/no-listing-09-guess-with-panic-msg-bug/output.txt
+4 −3 listings/ch11-writing-automated-tests/output-only-01-show-output/output.txt
+1 −1 listings/ch12-an-io-project/listing-12-01/output.txt
+2 −1 listings/ch12-an-io-project/listing-12-07/output.txt
+2 −1 listings/ch12-an-io-project/listing-12-08/output.txt
+4 −0 listings/ch12-an-io-project/listing-12-12/output.txt
+4 −3 listings/ch12-an-io-project/listing-12-16/output.txt
+1 −1 listings/ch12-an-io-project/output-only-01-with-args/output.txt
+1 −1 listings/ch12-an-io-project/output-only-02-missing-lifetimes/output.txt
+9 −2 listings/ch13-functional-features/listing-13-03/output.txt
+1 −1 listings/ch13-functional-features/listing-13-08/output.txt
+4 −0 listings/ch13-functional-features/listing-13-14/output.txt
+7 −1 listings/ch14-more-about-cargo/output-only-02-add-one/add/add_one/src/lib.rs
+1 −1 listings/ch15-smart-pointers/listing-15-03/output.txt
+1 −1 listings/ch15-smart-pointers/listing-15-09/output.txt
+7 −5 listings/ch15-smart-pointers/listing-15-15/output.txt
+1 −1 listings/ch15-smart-pointers/listing-15-17/output.txt
+7 −6 listings/ch15-smart-pointers/listing-15-21/output.txt
+2 −1 listings/ch15-smart-pointers/listing-15-23/output.txt
+6 −3 listings/ch15-smart-pointers/no-listing-01-cant-borrow-immutable-as-mutable/output.txt
+6 −6 listings/ch15-smart-pointers/output-only-01-comparing-to-reference/output.txt
+1 −1 listings/ch16-fearless-concurrency/listing-16-03/output.txt
+5 −1 listings/ch16-fearless-concurrency/listing-16-09/output.txt
+7 −6 listings/ch16-fearless-concurrency/listing-16-13/output.txt
+4 −6 listings/ch16-fearless-concurrency/listing-16-14/output.txt
+1 −1 listings/ch16-fearless-concurrency/output-only-01-move-drop/output.txt
+2 −2 listings/ch17-oop/listing-17-10/output.txt
+1 −1 listings/ch18-patterns-and-matching/listing-18-05/output.txt
+3 −12 listings/ch18-patterns-and-matching/listing-18-08/output.txt
+1 −1 listings/ch18-patterns-and-matching/listing-18-25/output.txt
+1 −1 listings/ch19-advanced-features/listing-19-05/output.txt
+1 −1 listings/ch19-advanced-features/listing-19-20/output.txt
+3 −3 listings/ch19-advanced-features/no-listing-02-impl-outlineprint-for-point/output.txt
+8 −4 listings/ch19-advanced-features/no-listing-18-returns-closure/output.txt
+1 −1 listings/ch19-advanced-features/output-only-01-missing-unsafe/output.txt
+1 −1 listings/ch20-web-server/listing-20-12/output.txt
+9 −1 listings/ch20-web-server/listing-20-17/output.txt
+3 −3 listings/ch20-web-server/listing-20-22/output.txt
+1 −1 listings/ch20-web-server/no-listing-01-define-threadpool-struct/output.txt
+2 −2 listings/ch20-web-server/no-listing-02-impl-threadpool-new/output.txt
+3 −3 listings/ch20-web-server/no-listing-04-update-worker-definition/output.txt
+1 −1 rust-toolchain
+2 −1 src/ch03-02-data-types.md
+1 −1 src/ch05-01-defining-structs.md
+10 −9 src/ch09-01-unrecoverable-errors-with-panic.md
+4 −6 src/ch09-02-recoverable-errors-with-result.md
+1 −1 src/ch15-01-box.md
+1 −1 src/title-page.md
2 changes: 1 addition & 1 deletion src/doc/rustc/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/doc/rustc/src/platform-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/assembly/targets/targets-elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b08a478

Please sign in to comment.