Skip to content

add feat_ cfg aliases#10444

Closed
xtqqczze wants to merge 22 commits intouutils:mainfrom
xtqqczze:cfg_aliases/tests
Closed

add feat_ cfg aliases#10444
xtqqczze wants to merge 22 commits intouutils:mainfrom
xtqqczze:cfg_aliases/tests

Conversation

@xtqqczze
Copy link
Contributor

@xtqqczze xtqqczze commented Jan 23, 2026

Resolve build failures on non-Linux platforms when selinux or smack features are enabled. The cfg attribute was missing target_os check, causing pre-commit hook failures.

@xtqqczze xtqqczze force-pushed the cfg_aliases/tests branch 3 times, most recently from 7296e46 to 0bf81c5 Compare January 23, 2026 01:15
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 23, 2026

Merging this PR will not alter performance

✅ 288 untouched benchmarks
⏩ 38 skipped benchmarks1


Comparing xtqqczze:cfg_aliases/tests (94b785f) with main (ce08ea0)

Open in CodSpeed

Footnotes

  1. 38 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.

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/fold/fold-zero-width is no longer failing!
Note: The gnu test tests/printf/printf-surprise is now being skipped but was previously passing.

@xtqqczze xtqqczze force-pushed the cfg_aliases/tests branch 2 times, most recently from b83eda5 to b48ad7d Compare January 23, 2026 02:20
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/printf/printf-surprise is now passing!

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/cut/bounded-memory. tests/cut/bounded-memory is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/date/date-locale-hour. tests/date/date-locale-hour is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/cut/cut-huge-range is now being skipped but was previously passing.
Note: The gnu test tests/expand/bounded-memory is now being skipped but was previously passing.
Congrats! The gnu test tests/dd/no-allocate is now passing!
Congrats! The gnu test tests/seq/seq-epipe is now passing!

@naoNao89
Copy link
Contributor

Checking uu_comm v0.6.0 (/Users/henri89/Documents/coreutils/src/uu/comm)
error[E0433]: failed to resolve: could not find `selinux` in `uucore`
   --> src/uu/id/src/id.rs:145:36
    |
145 |         selinux_supported: uucore::selinux::is_selinux_enabled(),
    |                                    ^^^^^^^ could not find `selinux` in `uucore`
    |
note: found an item that was configured out
   --> /Users/henri89/Documents/coreutils/src/uucore/src/lib/lib.rs:126:26
    |
125 | #[cfg(all(feature = "selinux", any(target_os = "linux", target_os = "android")))]
    |                                   -------------------------------------------- the item is gated here
126 | pub use crate::features::selinux;
    |                          ^^^^^^^

error[E0433]: failed to resolve: could not find `smack` in `uucore`
   --> src/uu/id/src/id.rs:147:34
    |
147 |         smack_supported: uucore::smack::is_smack_enabled(),
    |                                  ^^^^^ could not find `smack` in `uucore`
    |
note: found an item that was configured out
   --> /Users/henri89/Documents/coreutils/src/uucore/src/lib/lib.rs:129:26
    |
128 | #[cfg(all(target_os = "linux", feature = "smack"))]
    |           ------------------- the item is gated behind the `linux` feature
129 | pub use crate::features::smack;
    |                          ^^^^^

error[E0433]: failed to resolve: could not find `SecurityContext` in `selinux`
   --> src/uu/id/src/id.rs:184:43
    |
184 |             if let Ok(context) = selinux::SecurityContext::current(false) {
    |                                           ^^^^^^^^^^^^^^^ could not find `SecurityContext` in `selinux`

error[E0433]: failed to resolve: could not find `smack` in `uucore`
   --> src/uu/id/src/id.rs:198:27
    |
198 |             match uucore::smack::get_smack_label_for_self() {
    |                           ^^^^^ could not find `smack` in `uucore`
    |
note: found an item that was configured out
   --> /Users/henri89/Documents/coreutils/src/uucore/src/lib/lib.rs:129:26
    |
128 | #[cfg(all(target_os = "linux", feature = "smack"))]
    |           ------------------- the item is gated behind the `linux` feature
129 | pub use crate::features::smack;
    |                          ^^^^^

error[E0433]: failed to resolve: could not find `SecurityContext` in `selinux`
   --> src/uu/id/src/id.rs:711:39
    |
711 |         if let Ok(context) = selinux::SecurityContext::current(false) {
    |                                       ^^^^^^^^^^^^^^^ could not find `SecurityContext` in `selinux`

error[E0433]: failed to resolve: could not find `smack` in `uucore`
   --> src/uu/id/src/id.rs:723:36
    |
723 |         if let Ok(label) = uucore::smack::get_smack_label_for_self() {
    |                                    ^^^^^ could not find `smack` in `uucore`
    |
note: found an item that was configured out
   --> /Users/henri89/Documents/coreutils/src/uucore/src/lib/lib.rs:129:26
    |
128 | #[cfg(all(target_os = "linux", feature = "smack"))]
    |           ------------------- the item is gated behind the `linux` feature
129 | pub use crate::features::smack;
    |                          ^^^^^

For more information about this error, try `rustc --explain E0433`.
    Checking uu_chgrp v0.6.0 (/Users/henri89/Documents/coreutils/src/uu/chgrp)
error: could not compile `uu_id` (lib) due to 6 previous errors
warning: build failed, waiting for other jobs to finish..."

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/id/smack. tests/id/smack is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mkdir/smack-no-root. tests/mkdir/smack-no-root is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mkdir/smack-root. tests/mkdir/smack-root is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/cp/link-heap is now passing!

@xtqqczze xtqqczze force-pushed the cfg_aliases/tests branch 2 times, most recently from 37abe25 to 392c474 Compare February 17, 2026 16:40
@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/id/smack. tests/id/smack is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mkdir/smack-no-root. tests/mkdir/smack-no-root is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mkdir/smack-root. tests/mkdir/smack-root 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?
Skip an intermittent issue tests/tail/symlink (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/date/date-locale-hour is no longer failing!
Note: The gnu test tests/pr/bounded-memory is now being skipped but was previously passing.
Congrats! The gnu test tests/cp/link-heap is now passing!

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/cut/bounded-memory. tests/cut/bounded-memory is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/id/smack. tests/id/smack is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mkdir/smack-no-root. tests/mkdir/smack-no-root is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mkdir/smack-root. tests/mkdir/smack-root 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)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/expand/bounded-memory is now being skipped but was previously passing.

@xtqqczze xtqqczze force-pushed the cfg_aliases/tests branch 5 times, most recently from de2b54d to 40384e0 Compare February 17, 2026 18:09
@github-actions
Copy link

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/id/smack. tests/id/smack is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mkdir/smack-no-root. tests/mkdir/smack-no-root is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/mkdir/smack-root. tests/mkdir/smack-root is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/cp/link-heap is now passing!

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/id/smack. tests/id/smack is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/date/date-locale-hour is no longer failing!
Note: The gnu test tests/expand/bounded-memory is now being skipped but was previously passing.
Congrats! The gnu test tests/cp/link-heap is now passing!

@github-actions
Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/date/date-locale-hour is no longer failing!

@xtqqczze
Copy link
Contributor Author

@naoNao89 I will fix the selinux/smack issues in #11016

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

Comments