WASI integration tests fail when the test host is macOS
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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 asIs 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
000and callstouch -d ... -c. On a macOS host, wasmtime returnsNot supportedforutimensaton 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 thetarget_vendor = "apple"conditions in the date and tail tests. - Make sure the
wasi_runnerignore applies to everyrstestcase in the date test. - For touch, either ignore the test on macOS under
wasi_runner, or retryutimensatwithSYMLINK_NOFOLLOWinsrc/uu/touch/src/platform/wasi.rswhen the path is not a symlink. - Keep the macOS job in
wasi.ymlso these differences stay covered.
- 主要语言
- Rust
- 星标
- 24.3k
- 派生
- 2.2k
- 平均合并
- 2 天 5 小时
- 30 天内合并 PR
- 387
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
uutils/coreutils 的其他 Issue
-
pr: -o/--indent does not pad the header line可能已有人在做 @emirmrkaljevic 于 1 天前认领。 未关闭U - pr
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
realpath: empty operand aborts with a garbled error instead of being reported as missing可能已有人在做 @emirmrkaljevic 于 2 天前认领。 未关闭U - realpath
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 62/100
维护者通常 1 天内回复
-
nl: section delimiters reset --join-blank-lines grouping可能已有人在做 @coracoracora 于 3 天前认领。 未关闭U - nl
难度 2/5 1-3 小时 新手友好度 74/100
uutils/coreutils#16130 · 1 条评论 ·
维护者通常 1 天内回复
-
uniq: overflowing -f/-s/-w values with trailing garbage are silently accepted可能已有人在做 @huuan26 于 4 天前认领。 未关闭U - uniq
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
rubys/roundhouse#1917 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
pop-os/cosmic-applets#1619 ·
维护者通常 3 天内回复
-
binding:python bug
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复