Skip to content

add selinux/smack cfg alias#11016

Open
xtqqczze wants to merge 11 commits intouutils:mainfrom
xtqqczze:cfg_aliases/selinux
Open

add selinux/smack cfg alias#11016
xtqqczze wants to merge 11 commits intouutils:mainfrom
xtqqczze:cfg_aliases/selinux

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

@xtqqczze xtqqczze commented Feb 18, 2026

Fixes pre-commit hook failures on non-Linux platforms by adding proper #[cfg(target_os = "linux")] guards to selinux/smack feature gates.

Contributes to #11019

Closes #10995

@xtqqczze xtqqczze mentioned this pull request Feb 18, 2026
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/date/resolution. tests/date/resolution is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/rm/isatty. tests/rm/isatty is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/tail/retry. tests/tail/retry is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/pr/bounded-memory (fails in this run but passes in the 'main' branch)
Note: The gnu test tests/cp/link-heap is now being skipped but was previously passing.
Note: The gnu test tests/printf/printf-surprise is now being skipped but was previously passing.

@xtqqczze xtqqczze force-pushed the cfg_aliases/selinux branch from b98f746 to bf4239f Compare February 18, 2026 19:02
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Congrats! The gnu test tests/date/date-locale-hour is no longer failing!
Note: The gnu test tests/cp/link-heap is now being skipped but was previously passing.
Note: The gnu test tests/dd/no-allocate is now being skipped but was previously passing.
Note: The gnu test tests/seq/seq-epipe is now being skipped but was previously passing.
Note: The gnu test tests/tail/pipe-f is now being skipped but was previously passing.

@xtqqczze xtqqczze force-pushed the cfg_aliases/selinux branch from bf4239f to 0fcde2d Compare February 18, 2026 19:13
@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

Note: The gnu test tests/cut/cut-huge-range is now being skipped but was previously passing.

@xtqqczze xtqqczze marked this pull request as ready for review February 18, 2026 19:54
Copy link
Copy Markdown
Contributor

@sylvestre sylvestre left a comment

Choose a reason for hiding this comment

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

sorry
i really don't like the duplication of src/uu/*/build.rs

@xtqqczze
Copy link
Copy Markdown
Contributor Author

I don’t like the duplication either, but I’m not sure how to avoid it. Do you have suggestions on how we could factor this out?

@sylvestre
Copy link
Copy Markdown
Contributor

i prefer the current state than this duplication, sorry

@xtqqczze
Copy link
Copy Markdown
Contributor Author

xtqqczze commented Feb 19, 2026

I guess we could include!("../../common/common_cfg.rs") in each build.rs?

@sylvestre
Copy link
Copy Markdown
Contributor

if it works, it would be better

@xtqqczze
Copy link
Copy Markdown
Contributor Author

I've tried specifying the cfg in .cargo/config.toml but it doesn't support expressions like all(...) or any(...).

The only alternative I can think of is introducing a small common_cfg helper crate to centralize the cfg_aliases logic, but that feels a bit heavy-handed.

@xtqqczze
Copy link
Copy Markdown
Contributor Author

xtqqczze commented Feb 19, 2026

I guess we could include!("../../common/common_cfg.rs") in each build.rs?

@sylvestre If this works, would you approve the changes?

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Feb 20, 2026

Cannot we use workespace's toplevel build.rs?

@sylvestre
Copy link
Copy Markdown
Contributor

Cannot we use workespace's toplevel build.rs?

i don't think it works. i tried too and failed

@sylvestre
Copy link
Copy Markdown
Contributor

I guess we could include!("../../../common/common_cfg.rs") in each build.rs?

@sylvestre If this works, would you approve the changes?

yes
thanks

@xtqqczze
Copy link
Copy Markdown
Contributor Author

xtqqczze commented Apr 3, 2026

I guess we could include!("../../common/common_cfg.rs") in each build.rs?

Annoyingly, this didn't work.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 3, 2026

GNU testsuite comparison:

GNU test failed: tests/cp/cp-a-selinux. tests/cp/cp-a-selinux is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/date/date-locale-hour (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/cp/link-heap is now being skipped but was previously passing.
Note: The gnu test tests/env/env-signal-handler was skipped on 'main' but is now failing.

@sylvestre sylvestre force-pushed the cfg_aliases/selinux branch from 945a586 to 5d3b4fd Compare April 4, 2026 11:03
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2026

GNU testsuite comparison:

GNU test failed: tests/cp/cp-a-selinux. tests/cp/cp-a-selinux is passing on 'main'. Maybe you have to rebase?
Note: The gnu test tests/cut/cut-huge-range is now being skipped but was previously passing.

@xtqqczze xtqqczze force-pushed the cfg_aliases/selinux branch from 5d3b4fd to 971a907 Compare April 4, 2026 18:06
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2026

GNU testsuite comparison:

GNU test failed: tests/cp/cp-a-selinux. tests/cp/cp-a-selinux is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/cut/bounded-memory (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/tail/pipe-f is now passing!

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Apr 4, 2026

I don't like symlink since it breaks tarball extraction on Windows, but can you symlink build.rs?

@xtqqczze
Copy link
Copy Markdown
Contributor Author

I don't like symlink since it breaks tarball extraction on Windows, but can you symlink build.rs?

Can't do this because some utilities already have a build.rs.

@oech3
Copy link
Copy Markdown
Contributor

oech3 commented Apr 16, 2026

We should just keep long cfg if we need to have huge diff for this.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 16, 2026

GNU testsuite comparison:

GNU test failed: tests/cp/cp-a-selinux. tests/cp/cp-a-selinux is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/basenc/bounded-memory is now being skipped but was previously passing.
Note: The gnu test tests/csplit/csplit-heap is now being skipped but was previously passing.

@xtqqczze xtqqczze force-pushed the cfg_aliases/selinux branch from 585db72 to 2d7c6cb Compare April 19, 2026 03:50
@xtqqczze xtqqczze force-pushed the cfg_aliases/selinux branch from 2d7c6cb to a1ac235 Compare April 20, 2026 17:14
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.

3 participants