WASI integration tests fail when the test host is macOS

Aperta
#16,084 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@eduardomourar ci sta già lavorando.

Dal 31/10/2026.

  • #16082 di @eduardomourar — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
github-actions, macos, rust
Ambito
cli, testing

Direzione di ricerca

Start with the named date, tail, and touch tests, checking how their platform conditions and rstest ignore attributes behave under wasi_runner. Then read src/uu/touch/src/platform/wasi.rs and the macOS job in wasi.yml. Done means the listed tests pass on macOS with the WASI runner while the macOS job remains in place.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem

The WASI integration tests run only on ubuntu-latest. When the same tests run on macos-latest, 6 tests fail.

CI run with a macOS job: https://github.com/uutils/coreutils/actions/runs/41220415692/job/124593786020?pr=16082

Result: 3485 passed; 6 failed; 405 ignored.

The job uses macos-26-arm64, wasmtime v50.0.1 and wasm32-wasip1 with --cfg wasi_runner.

Failing tests

Test Actual output (WASI binary) Expected by the test
test_date::test_date_format_locale_ampm_markers::case_2_spanish_upper PM P. M.
test_date::test_date_format_locale_ampm_markers::case_3_spanish_time 08:17:48 PM 08:17:48 p. m.
test_date::test_date_format_locale_ampm_markers::case_4_british_lower pm p.m.
test_date::test_date_format_locale_ampm_markers::case_5_japanese PM 午後
test_tail::test_stdin_redirect_dir_when_target_os_is_macos tail: Is a directory tail: cannot open 'standard input' for reading: No such file or directory
test_touch::test_touch_set_time_on_unreadable_unwritable_file touch: setting times of 'no_rights': Not supported (exit code 1) success

Cause

The test crate runs on the host. The binary under test is the WASI guest.

  • date and tail: the tests use #[cfg(target_vendor = "apple")]. That condition is true for the host, so the tests expect native macOS output. The WASI guest does not see the host locale database. It also reports a directory read as Is a directory.
  • date: the test has #[cfg_attr(wasi_runner, ignore = "...")], but cases 2 to 5 still ran. Case 1 did not fail.
  • touch: the test creates a file with mode 000 and calls touch -d ... -c. On a macOS host, wasmtime returns Not supported for utimensat on that file. The same test passes on the Linux job. This was reproduced locally on macOS.

Reproduce

Run on a macOS host:

export RUSTFLAGS="--cfg wasi_runner"
cargo build --target wasm32-wasip1 --no-default-features --features feat_wasm
UUTESTS_BINARY_PATH="$(pwd)/target/wasm32-wasip1/debug/coreutils.wasm" \
UUTESTS_WASM_RUNNER=wasmtime \
cargo test --test tests --features nproc -- \
  test_date::test_date_format_locale_ampm_markers \
  test_tail::test_stdin_redirect_dir_when_target_os_is_macos \
  test_touch::test_touch_set_time_on_unreadable_unwritable_file

Proposed fix

  • Add not(wasi_runner) to the target_vendor = "apple" conditions in the date and tail tests.
  • Make sure the wasi_runner ignore applies to every rstest case in the date test.
  • For touch, either ignore the test on macOS under wasi_runner, or retry utimensat with SYMLINK_NOFOLLOW in src/uu/touch/src/platform/wasi.rs when the path is not a symlink.
  • Keep the macOS job in wasi.yml so these differences stay covered.
Lingua principale
Rust
Stelle
24.3k
Fork
2.1k
Merge medio
1g 22h
PR unite (30g)
396

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di uutils/coreutils

Tutte le issue di uutils/coreutils

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.