Skip to content

Commit 337487b

Browse files
authored
Rollup merge of rust-lang#60585 - sunfishcode:wasm32-wasi, r=alexcrichton
Omit the vendor component in the WASI triple This renames wasm32-unknown-wasi to wasm32-wasi, omitting the vendor component. This follows aarch64-linux-android, x86_64-fuchsia, and others in omitting the vendor field, which has the advantage of aligning with the [multiarch tuple](https://wiki.debian.org/Multiarch/Tuples), and of being less noisy. r? @alexcrichton
2 parents 929bd4d + 58624ed commit 337487b

File tree

6 files changed

+23
-23
lines changed

6 files changed

+23
-23
lines changed

config.toml.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@
480480
# linked binaries
481481
#musl-root = "..."
482482

483-
# The root location of the `wasm32-unknown-wasi` sysroot.
483+
# The root location of the `wasm32-wasi` sysroot.
484484
#wasi-root = "..."
485485

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

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ ENV TARGETS=x86_64-fuchsia
6969
ENV TARGETS=$TARGETS,aarch64-fuchsia
7070
ENV TARGETS=$TARGETS,sparcv9-sun-solaris
7171
ENV TARGETS=$TARGETS,wasm32-unknown-unknown
72-
ENV TARGETS=$TARGETS,wasm32-unknown-wasi
72+
ENV TARGETS=$TARGETS,wasm32-wasi
7373
ENV TARGETS=$TARGETS,x86_64-sun-solaris
7474
ENV TARGETS=$TARGETS,x86_64-unknown-linux-gnux32
7575
ENV TARGETS=$TARGETS,x86_64-unknown-cloudabi
@@ -79,5 +79,5 @@ ENV TARGETS=$TARGETS,nvptx64-nvidia-cuda
7979
ENV X86_FORTANIX_SGX_LIBS="/x86_64-fortanix-unknown-sgx/lib/"
8080

8181
ENV RUST_CONFIGURE_ARGS --enable-extended --enable-lld --disable-docs \
82-
--set target.wasm32-unknown-wasi.wasi-root=/wasm32-unknown-wasi
82+
--set target.wasm32-wasi.wasi-root=/wasm32-wasi
8383
ENV SCRIPT python2.7 ../x.py dist --target $TARGETS

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ git clone https://github.com/CraneStation/wasi-sysroot
1313

1414
cd wasi-sysroot
1515
git reset --hard e5f14be38362f1ab83302895a6e74b2ffd0e2302
16-
make -j$(nproc) INSTALL_DIR=/wasm32-unknown-wasi install
16+
make -j$(nproc) INSTALL_DIR=/wasm32-wasi install
1717

1818
cd ..
1919
rm -rf reference-sysroot-wasi

src/librustc_target/spec/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ supported_targets! {
444444
("asmjs-unknown-emscripten", asmjs_unknown_emscripten),
445445
("wasm32-unknown-emscripten", wasm32_unknown_emscripten),
446446
("wasm32-unknown-unknown", wasm32_unknown_unknown),
447-
("wasm32-unknown-wasi", wasm32_unknown_wasi),
447+
("wasm32-wasi", wasm32_wasi),
448448
("wasm32-experimental-emscripten", wasm32_experimental_emscripten),
449449

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

src/librustc_target/spec/wasm32_unknown_wasi.rs src/librustc_target/spec/wasm32_wasi.rs

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! The `wasm32-unknown-wasi` target is a new and still (as of March 2019)
1+
//! The `wasm32-wasi` 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,14 +13,14 @@
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
17-
//! wasm32-unknown-wasi toolchain.
16+
//! ideally avoiding the need to configure and install a local wasm32-wasi
17+
//! 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-unknown-wasi` target is the first with a
22-
//! viable C standard library and sysroot common definition, so we want Rust
23-
//! and C/C++ code to interoperate when compiled to `wasm32-unknown-unknown`.
21+
//! any other. To that the `wasm32-wasi` target is the first with a viable C
22+
//! standard library and sysroot common definition, so we want Rust and C/C++
23+
//! code to interoperate when compiled to `wasm32-unknown-unknown`.
2424
//!
2525
//! You'll note, however, that the two goals above are somewhat at odds with one
2626
//! another. To attempt to solve both use cases in one go we define a target
@@ -39,8 +39,8 @@
3939
//! necessary.
4040
//!
4141
//! All in all, by default, no external dependencies are required. You can
42-
//! compile `wasm32-unknown-wasi` binaries straight out of the box. You can't,
43-
//! however, reliably interoperate with C code in this mode (yet).
42+
//! compile `wasm32-wasi` binaries straight out of the box. You can't, however,
43+
//! reliably interoperate with C code in this mode (yet).
4444
//!
4545
//! ## Interop with C required
4646
//!
@@ -53,17 +53,17 @@
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-unknown-wasi` and is configured with the `wasm32-unknown-wasi`
57-
//! sysroot. This will cause Rust code to be linked against the libc.a that
58-
//! the specified `clang` provides.
56+
//! `wasm32-wasi` and is configured with the `wasm32-wasi` sysroot. This
57+
//! will cause Rust code to be linked against the libc.a that the specified
58+
//! `clang` provides.
5959
//!
6060
//! 3. If you're building a staticlib and integrating Rust code elsewhere, then
6161
//! compiling with `-C target-feature=-crt-static` is all you need to do.
6262
//!
6363
//! You can configure the linker via Cargo using the
64-
//! `CARGO_TARGET_WASM32_UNKNOWN_WASI_LINKER` env var. Be sure to also set
65-
//! `CC_wasm32-unknown-wasi` if any crates in the dependency graph are using
66-
//! the `cc` crate.
64+
//! `CARGO_TARGET_WASM32_WASI_LINKER` env var. Be sure to also set
65+
//! `CC_wasm32-wasi` if any crates in the dependency graph are using the `cc`
66+
//! crate.
6767
//!
6868
//! ## Remember, this is all in flux
6969
//!
@@ -82,7 +82,7 @@ pub fn target() -> Result<Target, String> {
8282
.pre_link_args
8383
.entry(LinkerFlavor::Gcc)
8484
.or_insert(Vec::new())
85-
.push("--target=wasm32-unknown-wasi".to_string());
85+
.push("--target=wasm32-wasi".to_string());
8686

8787
// When generating an executable be sure to put the startup object at the
8888
// front so the main function is correctly hooked up.
@@ -98,13 +98,13 @@ pub fn target() -> Result<Target, String> {
9898
options.crt_static_respected = true;
9999

100100
Ok(Target {
101-
llvm_target: "wasm32-unknown-wasi".to_string(),
101+
llvm_target: "wasm32-wasi".to_string(),
102102
target_endian: "little".to_string(),
103103
target_pointer_width: "32".to_string(),
104104
target_c_int_width: "32".to_string(),
105105
target_os: "wasi".to_string(),
106106
target_env: String::new(),
107-
target_vendor: "unknown".to_string(),
107+
target_vendor: String::new(),
108108
data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
109109
arch: "wasm32".to_string(),
110110
linker_flavor: LinkerFlavor::Lld(LldFlavor::Wasm),

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static TARGETS: &[&str] = &[
108108
"thumbv8m.main-none-eabihf",
109109
"wasm32-unknown-emscripten",
110110
"wasm32-unknown-unknown",
111-
"wasm32-unknown-wasi",
111+
"wasm32-wasi",
112112
"x86_64-apple-darwin",
113113
"x86_64-apple-ios",
114114
"x86_64-fortanix-unknown-sgx",

0 commit comments

Comments
 (0)