Skip to content

Commit 9abd5fa

Browse files
authored
Disable OsStrExt ettc. on WASIp2 on stable Rust. (#1301)
`OsStrExt` and friends aren't stable on the wasm32-wasip2 target yet, so disable features that depend on them when they aren't available. Fixes #1060.
1 parent 44a24c3 commit 9abd5fa

6 files changed

Lines changed: 29 additions & 48 deletions

File tree

.github/workflows/main.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ jobs:
8383
run: >
8484
rustup target add
8585
wasm32-wasip1
86+
wasm32-wasip2
8687
x86_64-unknown-fuchsia
8788
- if: matrix.rust == '1.63'
8889
run: rustup target add x86_64-fuchsia
@@ -102,6 +103,8 @@ jobs:
102103
- run: cargo check --workspace --release -vv --target=x86_64-unknown-netbsd --features=all-apis --all-targets
103104
- if: matrix.rust != '1.63'
104105
run: cargo check --workspace --release -vv --target=wasm32-wasip1 --features=all-apis
106+
- if: matrix.rust != '1.63'
107+
run: cargo check --workspace --release -vv --target=wasm32-wasip2 --features=all-apis
105108
- if: matrix.rust != '1.63'
106109
run: cargo check --workspace --release -vv --target=x86_64-unknown-fuchsia --features=all-apis --all-targets
107110
- if: matrix.rust == '1.63'
@@ -179,10 +182,8 @@ jobs:
179182
- run: >
180183
rustup target add
181184
x86_64-unknown-redox
182-
wasm32-wasip1
183185
thumbv7neon-unknown-linux-gnueabihf
184186
- run: cargo check --workspace --release -vv --target=x86_64-unknown-redox --features=all-apis
185-
- run: cargo check --workspace --release -vv --target=wasm32-wasip1 --features=all-apis
186187
- run: cargo check --workspace --release -vv --target=thumbv7neon-unknown-linux-gnueabihf --features=all-apis
187188

188189
check_tier3:

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,5 +261,6 @@ check-cfg = [
261261
'cfg(thumb_mode)',
262262
'cfg(wasi)',
263263
'cfg(wasi_ext)',
264+
'cfg(wasip2)',
264265
'cfg(target_arch, values("xtensa"))',
265266
]

build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ fn main() {
8282
// WASI support can utilize wasi_ext if present.
8383
if os == "wasi" {
8484
use_feature_or_nothing("wasi_ext");
85+
use_feature_or_nothing("wasip2");
8586
}
8687

8788
// If the libc backend is requested, or if we're not on a platform for

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
all(
55
target_os = "wasi",
66
target_env = "p2",
7-
any(feature = "fs", feature = "mount", feature = "net")
7+
any(feature = "fs", feature = "mount", feature = "net"),
8+
wasip2,
89
),
910
feature(wasip2)
1011
)]

0 commit comments

Comments
 (0)