Skip to content

refactor: use proc macro for wasi ignore reasons - #14964

Open
eduardomourar wants to merge 1 commit into
uutils:mainfrom
eduardomourar:refactor/wasi-ignore-reasons
Open

eduardomourar wants to merge 1 commit into
uutils:mainfrom
eduardomourar:refactor/wasi-ignore-reasons

Conversation

@eduardomourar

@eduardomourar eduardomourar commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Centralizes the ~400 #[cfg_attr(wasi_runner, ignore = "...")] annotations across the integration tests behind #[uutests::wasi_ignore(ReasonKey)], a proc-macro attribute defined in a new tests/uutests_procs crate.

Context: As per PR 14884 and PR 13687 flagged wasi_runner as a noisy, ad hoc cfg. It can't be replaced with target_os, since the tests always compile for the host (WASI can't spawn the child process they launch) — wasi_runner is the only signal a run is driving a wasm32-wasip1/wasm32-wasip2 binary via wasmtime. This doesn't remove the cfg, just the string-literal duplication around it: every reason is now defined once, alphabetically, in tests/uutests_procs/src/lib.rs 42 keys, down from an initial 57 after merging duplicates), including several that previously had no explanation at all.

#[uutests::wasi_ignore(Reason)] can also be applied to a mod { ... } block instead of one #[test] fn at a time; it recurses into nested modules and attaches the reason to every test inside. tee's linux_only module (21 tests) and truncate's fifo module (3 tests) use this instead of repeating the same key on every test.

Not touched: structural gates that aren't ignore-reasons (feat_diagnostics module gating, #[cfg(wasi_runner)] branches selecting alternate passing assertions).

@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/id/setgid. tests/id/setgid is passing on 'main'. Maybe you have to rebase?

@eduardomourar
eduardomourar force-pushed the refactor/wasi-ignore-reasons branch from 2a36443 to 088a962 Compare September 29, 2026 17:21
@codspeed

codspeed Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning, 1 note

⚠️ 118 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

ℹ️ 1 benchmark has no flamegraph

The flamegraph wasn't generated: most of the time was spent in runtime internals, which would leave nothing useful to analyze.

See affected benchmarks

✅ 401 untouched benchmarks
⏩ 70 skipped benchmarks1


Comparing eduardomourar:refactor/wasi-ignore-reasons (aebb327) with main (366c18c)2

Open in CodSpeed

Footnotes

  1. 70 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

  2. No successful run was found on main (6f5138a) during the generation of this report, so 366c18c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩

Comment thread Cargo.toml
Comment thread tests/by-util/test_ln.rs Outdated
Comment thread tests/uutests_procs/src/lib.rs Outdated
Comment thread tests/uutests_procs/src/lib.rs Outdated
Comment thread tests/uutests_procs/src/lib.rs Outdated
Comment thread tests/uutests_procs/src/lib.rs Outdated
@eduardomourar
eduardomourar force-pushed the refactor/wasi-ignore-reasons branch 5 times, most recently from 7fc1254 to 764dc3f Compare October 8, 2026 20:58

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can remove this whole file and add those as comments in tests/uutests_procs/src/lib.rs

@eduardomourar
eduardomourar force-pushed the refactor/wasi-ignore-reasons branch 2 times, most recently from bd1bf06 to 9dba18a Compare October 13, 2026 20:39
@eduardomourar
eduardomourar force-pushed the refactor/wasi-ignore-reasons branch 3 times, most recently from 0e35819 to a72b7ce Compare October 24, 2026 19:10
@eduardomourar
eduardomourar force-pushed the refactor/wasi-ignore-reasons branch from a72b7ce to aebb327 Compare October 24, 2026 19:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants