Skip to content

Commit 6eb55f1

Browse files
committed
Update the WASI support.
- WASI is now categorized as an OS rather than an environment. (rust-lang/rust#60117) - The WASI triple is renamed from wasm32-unknown-wasi to wasm32-wasi. (rust-lang/rust#60585)
1 parent 3142dee commit 6eb55f1

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ matrix:
6464
install:
6565
- rustup target add wasm32-unknown-unknown
6666
- rustup target add wasm32-unknown-emscripten
67-
- rustup target add wasm32-unknown-wasi
67+
- rustup target add wasm32-wasi
6868
- nvm install 9
6969
- ./utils/ci/install_cargo_web.sh
7070
- cargo web prepare-emscripten
@@ -81,7 +81,7 @@ matrix:
8181
#- cargo web test --target wasm32-unknown-emscripten
8282
#- cargo web test --nodejs --target wasm32-unknown-emscripten
8383
#- cargo build --target wasm32-unknown-unknown # without any features
84-
- cargo build --target wasm32-unknown-wasi
84+
- cargo build --target wasm32-wasi
8585
- cargo build --target wasm32-unknown-unknown --features=wasm-bindgen
8686
- cargo web test --target wasm32-unknown-unknown --features=stdweb
8787
- cargo build --manifest-path tests/wasm_bindgen/Cargo.toml --target wasm32-unknown-unknown

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ fuchsia-cprng = "0.1"
3636
wasm-bindgen = { version = "0.2.29", optional = true }
3737
stdweb = { version = "0.4.9", optional = true }
3838

39-
[target.wasm32-unknown-wasi.dependencies]
40-
libc = "0.2.51"
39+
[target.wasm32-wasi.dependencies]
40+
libc = "0.2.54"
4141

4242
[features]
4343
std = []

src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
//! enabled `wasm-bindgen` will be used. If neither feature is enabled,
4747
//! `getrandom` will always fail.
4848
//!
49-
//! The WASI target `wasm32-unknown-wasi` uses the `__wasi_random_get`
50-
//! function defined by the WASI standard.
49+
//! The WASI target `wasm32-wasi` uses the `__wasi_random_get` function defined
50+
//! by the WASI standard.
5151
//!
5252
//!
5353
//! ## Early boot
@@ -143,7 +143,7 @@ extern crate std;
143143
target_os = "linux",
144144
all(
145145
target_arch = "wasm32",
146-
not(target_env = "wasi")
146+
not(target_os = "wasi")
147147
),
148148
))]
149149
mod utils;
@@ -190,13 +190,13 @@ mod_use!(cfg(target_os = "redox"), use_file);
190190
mod_use!(cfg(target_os = "solaris"), solaris_illumos);
191191
mod_use!(cfg(windows), windows);
192192
mod_use!(cfg(target_env = "sgx"), sgx);
193-
mod_use!(cfg(target_env = "wasi"), wasi);
193+
mod_use!(cfg(target_os = "wasi"), wasi);
194194

195195
mod_use!(
196196
cfg(all(
197197
target_arch = "wasm32",
198198
not(target_os = "emscripten"),
199-
not(target_env = "wasi"),
199+
not(target_os = "wasi"),
200200
feature = "wasm-bindgen"
201201
)),
202202
wasm32_bindgen
@@ -206,7 +206,7 @@ mod_use!(
206206
cfg(all(
207207
target_arch = "wasm32",
208208
not(target_os = "emscripten"),
209-
not(target_env = "wasi"),
209+
not(target_os = "wasi"),
210210
not(feature = "wasm-bindgen"),
211211
feature = "stdweb",
212212
)),
@@ -237,7 +237,7 @@ mod_use!(
237237
target_arch = "wasm32",
238238
any(
239239
target_os = "emscripten",
240-
target_env = "wasi",
240+
target_os = "wasi",
241241
feature = "wasm-bindgen",
242242
feature = "stdweb",
243243
),

0 commit comments

Comments
 (0)