Skip to content

Commit ac76882

Browse files
committed
MCP661: Move wasm32-wasi-preview1-threads to Tier2
1 parent 3475fa7 commit ac76882

File tree

4 files changed

+24
-15
lines changed

4 files changed

+24
-15
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bin="$PWD/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04/bin"
1010
git clone https://github.com/WebAssembly/wasi-libc
1111

1212
cd wasi-libc
13-
git reset --hard 7018e24d8fe248596819d2e884761676f3542a04
13+
git reset --hard ec4566beae84e54952637f0bf61bee4b4cacc087
1414
make -j$(nproc) \
1515
CC="$bin/clang" \
1616
NM="$bin/llvm-nm" \

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ bin="$PWD/clang+llvm-16.0.4-x86_64-linux-gnu-ubuntu-22.04/bin"
1010
git clone https://github.com/WebAssembly/wasi-libc
1111

1212
cd wasi-libc
13-
git reset --hard 7018e24d8fe248596819d2e884761676f3542a04
13+
git reset --hard ec4566beae84e54952637f0bf61bee4b4cacc087
1414
make -j$(nproc) \
1515
CC="$bin/clang" \
1616
NM="$bin/llvm-nm" \

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ target | std | notes
179179
`wasm32-unknown-emscripten` | ✓ | WebAssembly via Emscripten
180180
`wasm32-unknown-unknown` | ✓ | WebAssembly
181181
`wasm32-wasi` | ✓ | WebAssembly with WASI
182+
[`wasm32-wasi-preview1-threads`](platform-support/wasm32-wasi-preview1-threads.md) | ✓ | | WebAssembly with WASI Preview 1 and threads
182183
`x86_64-apple-ios` | ✓ | 64-bit x86 iOS
183184
[`x86_64-fortanix-unknown-sgx`](platform-support/x86_64-fortanix-unknown-sgx.md) | ✓ | [Fortanix ABI] for 64-bit Intel SGX
184185
`x86_64-fuchsia` | ✓ | Alias for `x86_64-unknown-fuchsia`
@@ -321,7 +322,6 @@ target | std | host | notes
321322
`thumbv7a-pc-windows-msvc` | ? | |
322323
`thumbv7a-uwp-windows-msvc` | ✓ | |
323324
`thumbv7neon-unknown-linux-musleabihf` | ? | | Thumb2-mode ARMv7-A Linux with NEON, MUSL
324-
[`wasm32-wasi-preview1-threads`](platform-support/wasm32-wasi-preview1-threads.md) | ✓ | | WebAssembly with WASI Preview 1 and threads
325325
[`wasm64-unknown-unknown`](platform-support/wasm64-unknown-unknown.md) | ? | | WebAssembly
326326
`x86_64-apple-ios-macabi` | ✓ | | Apple Catalyst on x86_64
327327
[`x86_64-apple-tvos`](platform-support/apple-tvos.md) | ? | | x86 64-bit tvOS

src/doc/rustc/src/platform-support/wasm32-wasi-preview1-threads.md

+21-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `wasm32-wasi-preview1-threads`
22

3-
**Tier: 3**
3+
**Tier: 2**
44

55
The `wasm32-wasi-preview1-threads` target is a new and still (as of July 2023) an
66
experimental target. This target is an extension to `wasm32-wasi-preview1` target,
@@ -70,12 +70,6 @@ compile `wasm32-wasi-preview1-threads` binaries straight out of the box. You can
7070
reliably interoperate with C code in this mode (yet).
7171

7272

73-
This target is not a stable target. This means that there are not many engines
74-
which implement the `wasi-threads` feature and if they do they're likely behind a
75-
flag, for example:
76-
77-
* Wasmtime - `--wasm-features=threads --wasi-modules=experimental-wasi-threads`
78-
7973
Also note that at this time the `wasm32-wasi-preview1-threads` target assumes the
8074
presence of other merged wasm proposals such as (with their LLVM feature flags):
8175

@@ -94,6 +88,17 @@ The target intends to match the corresponding Clang target for its `"C"` ABI.
9488
> found it's recommended to open an issue either with rust-lang/rust or ideally
9589
> with LLVM itself.
9690
91+
## Platform requirements
92+
93+
The runtime should support the same set of APIs as any other supported wasi target for interacting with the host environment through the WASI standard. The runtime also should have implemetation of [wasi-threads proposal](https://github.com/WebAssembly/wasi-threads).
94+
95+
This target is not a stable target. This means that there are a few engines
96+
which implement the `wasi-threads` feature and if they do they're likely behind a
97+
flag, for example:
98+
99+
* Wasmtime - `--wasm-features=threads --wasi-modules=experimental-wasi-threads`
100+
* [WAMR](https://github.com/bytecodealliance/wasm-micro-runtime) - needs to be built with WAMR_BUILD_LIB_WASI_THREADS=1
101+
97102
## Building the target
98103

99104
Users need to install or built wasi-sdk since release 20.0
@@ -110,12 +115,16 @@ After that users can build this by adding it to the `target` list in
110115

111116
## Building Rust programs
112117

113-
Since it is Tier 3, rust doesn't ship pre-compiled artifacts for this target.
118+
From Rust Nightly 1.71.1 (2023-08-03) on the artifacts are shipped pre-compiled:
119+
120+
```text
121+
rustup target add wasm32-wasi-preview1-threads --toolchain nightly
122+
```
123+
124+
Rust programs can be built for that target:
114125

115-
Specify `wasi-root` as explained in the previous section and then use the `build-std`
116-
nightly cargo feature to build the standard library:
117-
```shell
118-
cargo +nightly build --target=wasm32-wasi-preview1-threads -Zbuild-std
126+
```text
127+
rustc --target wasm32-wasi-preview1-threads your-code.rs
119128
```
120129

121130
## Cross-compilation

0 commit comments

Comments
 (0)