Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 21 additions & 20 deletions .github/workflows/wasi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ jobs:
fail-fast: false
matrix:
job:
- { target: wasm32-wasip1, rust-flags: "--cfg wasi_runner" }
- { target: wasm32-wasip2, rust-flags: "--cfg wasi_runner --cfg wasip2_runner" }
- { target: wasm32-wasip1, rust-flags: "--cfg wasi_runner", toolchain: stable }
# wasm32-wasip2 needs a toolchain where `std::process::exit` propagates the
# real exit code through `wasi:cli/exit#exit` instead of collapsing every
# nonzero code to 1; only available on nightly for now.
- { target: wasm32-wasip2, rust-flags: "--cfg wasi_runner --cfg wasip2_runner", toolchain: nightly }
steps:
- uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@${{ matrix.job.toolchain }}
with:
targets: ${{ matrix.job.target }}
- uses: Swatinem/rust-cache@v2
Expand All @@ -48,7 +51,6 @@ jobs:
UTILS=$(./util/show-utils.sh | tr ' ' '\n' | grep -vE "^($EXCLUDE)$" | sed 's/^/-p uu_/' | tr '\n' ' ')
cargo test --target ${{ matrix.job.target }} --no-default-features $UTILS
- name: Run integration tests via wasmtime
if: matrix.job.target == 'wasm32-wasip1'
env:
RUSTFLAGS: ${{ matrix.job.rust-flags }}
run: |
Expand All @@ -60,22 +62,21 @@ jobs:
# The binary above is built without default features, so it has no
# caret diagnostics; the host test crate does have them, hence the
# not(wasi_runner) in the cfg guarding every `mod diagnostics`.
# TODO: add integration tests for these tools as WASI support is extended:
# arch b2sum cksum csplit date dir dircolors fmt join
# ls md5sum mkdir mv nproc pathchk pr printenv ptx pwd readlink
# realpath rm rmdir seq sha1sum sha224sum sha256sum sha384sum
# sha512sum shred sleep sort split tsort uname uniq vdir
UUTESTS_BINARY_PATH="$(pwd)/target/${{ matrix.job.target }}/debug/coreutils.wasm" \
UUTESTS_WASM_RUNNER=wasmtime \
cargo test --test tests -- \
test_base32:: test_base64:: test_basenc:: test_basename:: \
test_cat:: test_comm:: test_cp:: test_cut:: test_dirname:: test_echo:: \
test_expand:: test_expr:: test_factor:: test_false:: test_fold:: \
test_head:: test_link:: test_ln:: \
test_ls::test_ls_a_dotdot_no_error_on_wasi \
test_ls::test_ls_al_no_capabilities_insufficient_on_wasi \
test_mktemp:: test_nl:: test_numfmt:: \
test_od:: test_paste:: test_printf:: test_shuf:: test_sum:: \
test_tail:: test_tee:: test_test:: test_touch:: test_tr:: \
test_true:: test_truncate:: \
test_unexpand:: test_unlink:: test_wc:: test_yes::
test_arch:: test_b2sum:: test_base32:: test_base64:: test_basename:: \
test_basenc:: test_cat:: test_cksum:: test_comm:: test_cp:: \
test_csplit:: test_cut:: test_date:: test_dd:: test_dir:: \
test_dircolors:: test_dirname:: test_echo:: test_expand:: test_expr:: \
test_factor:: test_false:: test_fmt:: test_fold:: test_head:: \
test_join:: test_link:: test_ln:: test_ls:: test_md5sum:: test_mkdir:: \
test_mktemp:: test_mv:: test_nl:: test_nproc:: test_numfmt:: test_od:: \
test_paste:: test_pathchk:: test_pr:: test_printenv:: test_printf:: \
test_ptx:: test_pwd:: test_readlink:: test_realpath:: test_rm:: \
test_rmdir:: test_seq:: test_sha1sum:: test_sha224sum:: \
test_sha256sum:: test_sha384sum:: test_sha512sum:: test_shred:: \
test_shuf:: test_sleep:: test_sort:: test_split:: test_sum:: \
test_tail:: test_tee:: test_test:: test_touch:: test_tr:: test_true:: \
test_truncate:: test_tsort:: test_tty:: test_uname:: test_unexpand:: \
test_uniq:: test_unlink:: test_vdir:: test_wc:: test_yes::
6 changes: 6 additions & 0 deletions .vscode/cspell.dictionaries/workspace.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,13 @@ ENODATA
ENOENT
ENOSPC
ENOSYS
ENOTDIR
ENOTEMPTY
EOPNOTSUPP
EPERM
EPIPE
EROFS
ETXTBSY

# * vars/fcntl
F_GETFL
Expand Down Expand Up @@ -181,8 +183,10 @@ addrlen
blocksize
canonname
chroot
cmdline
dlsym
execvp
fchmod
fdatasync
freeaddrinfo
getaddrinfo
Expand All @@ -202,6 +206,7 @@ inodes
isatty
lchown
pathlen
reflink
setgid
setgroups
settime
Expand All @@ -216,6 +221,7 @@ strerror
strlen
syncfs
umask
unflushed
waitpid

# * vars/nix
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(pgo_training)',
'cfg(target_os, values("cygwin"))',
'cfg(wasi_runner)',
'cfg(wasip2_runner)',
] }
unused_qualifications = "warn"

Expand Down
Loading
Loading