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 regress 4 benchmarks

⚡ 13 improved benchmarks
❌ 4 regressed benchmarks
✅ 382 untouched benchmarks
⏩ 54 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ Simulation three_39_bit_primes 545.9 ms 687 ms -20.53%
❌ Simulation five_38_bit_primes 1.7 s 1.9 s -10.12%
❌ Simulation sort_dictionary_order[500000] 1.9 s 2.1 s -6.54%
❌ Simulation rm_recursive_tree 13.7 ms 14.4 ms -5.02%
⚡ Simulation cut_fields_custom_delim 65.9 ms 51.9 ms +27%
⚡ Simulation cut_fields_tab 57.4 ms 45.5 ms +26.24%
⚡ Simulation cut_bytes 18.1 ms 15.5 ms +16.69%
⚡ Simulation check_sorted_utf8_locale 491.1 ms 422.9 ms +16.13%
⚡ Simulation sort_numeric_utf8_locale 40.8 ms 36.1 ms +12.88%
⚡ Simulation merge_single_file_utf8_locale 133.4 ms 119.3 ms +11.83%
⚡ Simulation cut_characters 25.4 ms 22.9 ms +10.88%
⚡ Simulation thirteen_39_bit_primes 9.3 s 8.5 s +8.47%
⚡ Simulation merge_pre_sorted_files_utf8_locale 251.9 ms 238 ms +5.82%
⚡ Simulation merge_pre_sorted_files 252.5 ms 238.8 ms +5.74%
⚡ Simulation sort_german_de_locale 295 ms 282.1 ms +4.59%
⚡ Simulation sort_case_sensitive[500000] 334.9 ms 321 ms +4.32%
⚡ Simulation sort_spill_to_tmp_files_utf8_locale 332.1 ms 321 ms +3.44%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing eduardomourar:refactor/wasi-ignore-reasons (764dc3f) with main (8f6a838)2

Open in CodSpeed

Footnotes

  1. 54 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 (ca3e965) during the generation of this report, so 8f6a838 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 4 times, most recently from 5353ad6 to 7fc1254 Compare October 6, 2026 20:45
@eduardomourar
eduardomourar force-pushed the refactor/wasi-ignore-reasons branch 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

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