Skip to content

Commit 5bcb694

Browse files
authored
Add WASIp3 support (rust-random#779)
1 parent a3e97f3 commit 5bcb694

6 files changed

Lines changed: 307 additions & 29 deletions

File tree

.github/workflows/tests.yml

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,23 +336,57 @@ jobs:
336336
# Firefox doesn't support module service workers and therefor can't import scripts
337337
run: wasm-pack test --headless --chrome -- ${{ matrix.rust.args }}
338338

339-
wasi:
340-
name: WASI
339+
wasi_p1:
340+
name: WASIp1
341341
runs-on: ubuntu-24.04
342342
steps:
343343
- uses: actions/checkout@v6
344344
- uses: dtolnay/rust-toolchain@master
345345
with:
346346
toolchain: 1.85
347-
targets: wasm32-wasip1,wasm32-wasip2
347+
targets: wasm32-wasip1
348348
- name: Install Wasmtime
349349
run: |
350-
VERSION=v24.0.0
350+
VERSION=v40.0.0
351351
URL=https://github.com/bytecodealliance/wasmtime/releases/download/${VERSION}/wasmtime-${VERSION}-x86_64-linux.tar.xz
352352
wget -O - $URL | tar -xJ --strip-components=1 -C ~/.cargo/bin
353353
wasmtime --version
354354
- uses: Swatinem/rust-cache@v2
355-
- name: WASI 0.1 Test
356-
run: cargo test --target wasm32-wasip1
357-
- name: WASI 0.2 Test
358-
run: cargo test --target wasm32-wasip2
355+
- run: cargo test --target wasm32-wasip1
356+
357+
wasi_p2:
358+
name: WASIp2
359+
runs-on: ubuntu-24.04
360+
steps:
361+
- uses: actions/checkout@v6
362+
- uses: dtolnay/rust-toolchain@master
363+
with:
364+
toolchain: 1.85
365+
targets: wasm32-wasip2
366+
- name: Install Wasmtime
367+
run: |
368+
VERSION=v40.0.0
369+
URL=https://github.com/bytecodealliance/wasmtime/releases/download/${VERSION}/wasmtime-${VERSION}-x86_64-linux.tar.xz
370+
wget -O - $URL | tar -xJ --strip-components=1 -C ~/.cargo/bin
371+
wasmtime --version
372+
- uses: Swatinem/rust-cache@v2
373+
- run: cargo test --target wasm32-wasip2
374+
375+
# TODO: enable after pre-built std will be provided by Rust
376+
# wasi_p3:
377+
# name: WASIp3
378+
# runs-on: ubuntu-24.04
379+
# steps:
380+
# - uses: actions/checkout@v6
381+
# - uses: dtolnay/rust-toolchain@master
382+
# with:
383+
# toolchain: 1.90
384+
# targets: wasm32-wasip3
385+
# - name: Install Wasmtime
386+
# run: |
387+
# VERSION=v40.0.0
388+
# URL=https://github.com/bytecodealliance/wasmtime/releases/download/${VERSION}/wasmtime-${VERSION}-x86_64-linux.tar.xz
389+
# wget -O - $URL | tar -xJ --strip-components=1 -C ~/.cargo/bin
390+
# wasmtime --version
391+
# - uses: Swatinem/rust-cache@v2
392+
# - run: cargo test --target wasm32-wasip3

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Added
1010
- `RawOsError` type alias [#739]
1111
- `SysRng` behind new feature `sys_rng` [#751]
12+
- WASIp3 support [#779]
1213

1314
### Changed
1415
- Use Edition 2024 and MSRV 1.85 [#749]
1516

1617
[#739]: https://github.com/rust-random/getrandom/pull/739
1718
[#749]: https://github.com/rust-random/getrandom/pull/749
1819
[#751]: https://github.com/rust-random/getrandom/pull/751
20+
[#779]: https://github.com/rust-random/getrandom/pull/779
1921

2022
## [0.3.4] - 2025-10-14
2123

0 commit comments

Comments
 (0)