Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 4583ef2

Browse files
committed
Auto merge of rust-lang#110596 - yoshuawuyts:rename-wasm32-wasi, r=<try>
Rename `wasm32-wasi` to `wasm32-wasi-preview1` Implements rust-lang/compiler-team#607
2 parents dfe0683 + 07241ee commit 4583ef2

File tree

14 files changed

+44
-25
lines changed

14 files changed

+44
-25
lines changed

compiler/rustc_target/src/spec/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,7 +1399,7 @@ supported_targets! {
13991399
("asmjs-unknown-emscripten", asmjs_unknown_emscripten),
14001400
("wasm32-unknown-emscripten", wasm32_unknown_emscripten),
14011401
("wasm32-unknown-unknown", wasm32_unknown_unknown),
1402-
("wasm32-wasi", wasm32_wasi),
1402+
("wasm32-wasi-preview1", wasm32_wasi_preview1),
14031403
("wasm64-unknown-unknown", wasm64_unknown_unknown),
14041404

14051405
("thumbv6m-none-eabi", thumbv6m_none_eabi),

compiler/rustc_target/src/spec/wasm32_wasi.rs renamed to compiler/rustc_target/src/spec/wasm32_wasi_preview1.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! The `wasm32-wasi` target is a new and still (as of April 2019) an
1+
//! The `wasm32-wasi-preview1` target is a new and still (as of April 2019) an
22
//! experimental target. The definition in this file is likely to be tweaked
33
//! over time and shouldn't be relied on too much.
44
//!
@@ -13,12 +13,12 @@
1313
//! serve two use cases here with this target:
1414
//!
1515
//! * First, we want Rust usage of the target to be as hassle-free as possible,
16-
//! ideally avoiding the need to configure and install a local wasm32-wasi
16+
//! ideally avoiding the need to configure and install a local wasm32-wasi-preview1
1717
//! toolchain.
1818
//!
1919
//! * Second, one of the primary use cases of LLVM's new wasm backend and the
2020
//! wasm support in LLD is that any compiled language can interoperate with
21-
//! any other. To that the `wasm32-wasi` target is the first with a viable C
21+
//! any other. To that the `wasm32-wasi-preview1` target is the first with a viable C
2222
//! standard library and sysroot common definition, so we want Rust and C/C++
2323
//! code to interoperate when compiled to `wasm32-unknown-unknown`.
2424
//!
@@ -39,7 +39,7 @@
3939
//! necessary.
4040
//!
4141
//! All in all, by default, no external dependencies are required. You can
42-
//! compile `wasm32-wasi` binaries straight out of the box. You can't, however,
42+
//! compile `wasm32-wasi-preview1` binaries straight out of the box. You can't, however,
4343
//! reliably interoperate with C code in this mode (yet).
4444
//!
4545
//! ## Interop with C required
@@ -53,7 +53,7 @@
5353
//!
5454
//! 2. If you're using rustc to build a linked artifact then you'll need to
5555
//! specify `-C linker` to a `clang` binary that supports
56-
//! `wasm32-wasi` and is configured with the `wasm32-wasi` sysroot. This
56+
//! `wasm32-wasi-preview1` and is configured with the `wasm32-wasi-preview1` sysroot. This
5757
//! will cause Rust code to be linked against the libc.a that the specified
5858
//! `clang` provides.
5959
//!

config.example.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -776,9 +776,9 @@ changelog-seen = 2
776776
# The full path to the musl libdir.
777777
#musl-libdir = musl-root/lib
778778

779-
# The root location of the `wasm32-wasi` sysroot. Only used for the
780-
# `wasm32-wasi` target. If you are building wasm32-wasi target, make sure to
781-
# create a `[target.wasm32-wasi]` section and move this field there.
779+
# The root location of the `wasm32-wasi-preview1` sysroot. Only used for the
780+
# `wasm32-wasi-preview1` target. If you are building wasm32-wasi-preview1 target, make sure to
781+
# create a `[target.wasm32-wasi-preview1]` section and move this field there.
782782
#wasi-root = <none> (path)
783783

784784
# Used in testing for configuring where the QEMU images are located, you

library/std/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fortanix-sgx-abi = { version = "0.5.0", features = ['rustc-dep-of-std'], public
4848
[target.'cfg(target_os = "hermit")'.dependencies]
4949
hermit-abi = { version = "0.3.0", features = ['rustc-dep-of-std'] }
5050

51-
[target.wasm32-wasi.dependencies]
51+
[target.wasm32-wasi-preview1.dependencies]
5252
wasi = { version = "0.11.0", features = ['rustc-dep-of-std'], default-features = false }
5353

5454
[features]

library/std/src/os/wasi/io/raw.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// As a result, the items in os::fd::raw were given the
1414
// rustc_allowed_through_unstable_modules attribute.
1515
// No regression tests were added to ensure this property,
16-
// as CI is not configured to test wasm32-wasi.
16+
// as CI is not configured to test wasm32-wasi-preview1.
1717
// If this module is stabilized,
1818
// you may want to remove those attributes
1919
// (assuming no other unstable modules need them).

src/bootstrap/compile.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ fn copy_self_contained_objects(
306306
.unwrap_or_else(|| {
307307
panic!("Target {:?} does not have a \"wasi-root\" key", target.triple)
308308
})
309-
.join("lib/wasm32-wasi");
309+
.join("lib/wasm32-wasi-preview1");
310310
for &obj in &["libc.a", "crt1-command.o", "crt1-reactor.o"] {
311311
copy_and_stamp(
312312
builder,
@@ -408,7 +408,7 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, stage: u32, car
408408

409409
if target.ends_with("-wasi") {
410410
if let Some(p) = builder.wasi_root(target) {
411-
let root = format!("native={}/lib/wasm32-wasi", p.to_str().unwrap());
411+
let root = format!("native={}/lib/wasm32-wasi-preview1", p.to_str().unwrap());
412412
cargo.rustflag("-L").rustflag(&root);
413413
}
414414
}

src/bootstrap/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ impl Step for CompiletestTest {
739739
&[],
740740
);
741741
cargo.allow_features("test");
742+
cargo.env("RUSTC_STAGE", builder.top_stage.to_string());
742743
run_cargo_test(cargo, &[], &[], "compiletest", compiler, host, builder);
743744
}
744745
}

src/ci/docker/host-x86_64/dist-various-2/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ ENV CARGO_TARGET_AARCH64_UNKNOWN_FUCHSIA_RUSTFLAGS \
113113
ENV TARGETS=x86_64-unknown-fuchsia
114114
ENV TARGETS=$TARGETS,aarch64-unknown-fuchsia
115115
ENV TARGETS=$TARGETS,wasm32-unknown-unknown
116-
ENV TARGETS=$TARGETS,wasm32-wasi
116+
ENV TARGETS=$TARGETS,wasm32-wasi-preview1
117117
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
118118
ENV TARGETS=$TARGETS,x86_64-pc-solaris
119119
ENV TARGETS=$TARGETS,x86_64-sun-solaris
@@ -135,7 +135,7 @@ ENV TARGETS=$TARGETS,x86_64-unknown-uefi
135135
RUN ln -s /usr/include/asm-generic /usr/local/include/asm
136136

137137
ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --disable-docs \
138-
--set target.wasm32-wasi.wasi-root=/wasm32-wasi \
138+
--set target.wasm32-wasi-preview1.wasi-root=/wasm32-wasi-preview1 \
139139
--musl-root-armv7=/musl-armv7
140140

141141
ENV SCRIPT python3 ../x.py dist --host='' --target $TARGETS

src/ci/docker/host-x86_64/dist-various-2/build-wasi-toolchain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ make -j$(nproc) \
1515
CC="$bin/clang" \
1616
NM="$bin/llvm-nm" \
1717
AR="$bin/llvm-ar" \
18-
INSTALL_DIR=/wasm32-wasi \
18+
INSTALL_DIR=/wasm32-wasi-preview1 \
1919
install
2020

2121
cd ..

src/doc/rustc/src/platform-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ target | std | notes
178178
`thumbv8m.main-none-eabihf` | * | Bare ARMv8-M Mainline, hardfloat
179179
`wasm32-unknown-emscripten` | ✓ | WebAssembly via Emscripten
180180
`wasm32-unknown-unknown` | ✓ | WebAssembly
181-
`wasm32-wasi` | ✓ | WebAssembly with WASI
181+
`wasm32-wasi-preview1` | ✓ | WebAssembly with WASI Preview 1
182182
`x86_64-apple-ios` | ✓ | 64-bit x86 iOS
183183
[`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX
184184
`x86_64-fuchsia` | ✓ | Alias for `x86_64-unknown-fuchsia`

src/tools/build-manifest/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static TARGETS: &[&str] = &[
136136
"thumbv8m.main-none-eabihf",
137137
"wasm32-unknown-emscripten",
138138
"wasm32-unknown-unknown",
139-
"wasm32-wasi",
139+
"wasm32-wasi-preview1",
140140
"x86_64-apple-darwin",
141141
"x86_64-apple-ios",
142142
"x86_64-fortanix-unknown-sgx",

src/tools/compiletest/src/header/tests.rs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ fn pointer_width() {
435435

436436
#[test]
437437
fn wasm_special() {
438-
let ignores = [
438+
let mut ignores = vec![
439439
("wasm32-unknown-unknown", "emscripten", true),
440440
("wasm32-unknown-unknown", "wasm32", true),
441441
("wasm32-unknown-unknown", "wasm32-bare", true),
@@ -446,15 +446,33 @@ fn wasm_special() {
446446
("wasm32-unknown-emscripten", "emscripten", true),
447447
("wasm32-unknown-emscripten", "wasm32", true),
448448
("wasm32-unknown-emscripten", "wasm32-bare", false),
449-
("wasm32-wasi", "emscripten", false),
450-
("wasm32-wasi", "wasm32", true),
451-
("wasm32-wasi", "wasm32-bare", false),
452-
("wasm32-wasi", "wasi", true),
453449
("wasm64-unknown-unknown", "emscripten", false),
454450
("wasm64-unknown-unknown", "wasm32", false),
455451
("wasm64-unknown-unknown", "wasm32-bare", false),
456452
("wasm64-unknown-unknown", "wasm64", true),
457453
];
454+
455+
// FIXME(yosh): We're updating the "wasm32-wasi" target name to "wasm32-wasi-preview1".
456+
// The MinGW tests run a beta compiler on stage 0 which means we're having a target mismatch
457+
// for a brief period. When a new beta release is cut, the `if` part of this conditional should be
458+
// removed, and the `else` part should be re-inlined in the original `ignores` list.
459+
// cfg(bootstrap)
460+
if env!("RUSTC_STAGE") == "0" {
461+
ignores.append(&mut vec![
462+
("wasm32-wasi", "emscripten", false),
463+
("wasm32-wasi", "wasm32", true),
464+
("wasm32-wasi", "wasm32-bare", false),
465+
("wasm32-wasi", "wasi", true),
466+
]);
467+
} else {
468+
ignores.append(&mut vec![
469+
("wasm32-wasi-preview1", "emscripten", false),
470+
("wasm32-wasi-preview1", "wasm32", true),
471+
("wasm32-wasi-preview1", "wasm32-bare", false),
472+
("wasm32-wasi-preview1", "wasi", true),
473+
]);
474+
}
475+
458476
for (target, pattern, ignore) in ignores {
459477
let mut config = config();
460478
config.target = target.to_string();

src/tools/miri/ci.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ case $HOST_TARGET in
110110
MIRI_TEST_TARGET=i686-pc-windows-msvc run_tests
111111
MIRI_TEST_TARGET=x86_64-unknown-freebsd run_tests_minimal hello integer vec panic/panic concurrency/simple atomic data_race env/var
112112
MIRI_TEST_TARGET=aarch64-linux-android run_tests_minimal hello integer vec panic/panic
113-
MIRI_TEST_TARGET=wasm32-wasi run_tests_minimal no_std integer strings
113+
MIRI_TEST_TARGET=wasm32-wasi-preview1 run_tests_minimal no_std integer strings
114114
MIRI_TEST_TARGET=wasm32-unknown-unknown run_tests_minimal no_std integer strings
115115
MIRI_TEST_TARGET=thumbv7em-none-eabihf MIRI_NO_STD=1 run_tests_minimal no_std # no_std embedded architecture
116116
MIRI_TEST_TARGET=tests/avr.json MIRI_NO_STD=1 run_tests_minimal no_std # JSON target file

tests/assembly/stack-protector/stack-protector-target-support.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
// [r71] needs-llvm-components: webassembly
151151
// [r72] compile-flags:--target wasm32-unknown-unknown
152152
// [r72] needs-llvm-components: webassembly
153-
// [r73] compile-flags:--target wasm32-wasi
153+
// [r73] compile-flags:--target wasm32-wasi-preview1
154154
// [r73] needs-llvm-components: webassembly
155155
// [r74] compile-flags:--target x86_64-apple-ios
156156
// [r74] needs-llvm-components: x86

0 commit comments

Comments
 (0)