build: gate SELinux utilities behind feat_selinux#12395
Conversation
b21169d to
f2bc7bb
Compare
Merging this PR will not alter performance
Comparing Footnotes
|
|
GNU testsuite comparison: |
a785135 to
5951317
Compare
9c2ce67 to
f3e11b8
Compare
f3e11b8 to
b6c7276
Compare
|
GnuTests / Aggregate GNU test results (pull_request) failure tracked by #12466. |
|
dep cleanup is oke , but still need a temporary stub or fallback because Linux packaging expects these coreutils binaries to exist. If SELinux is disabled, check this $ cargo build -p uu_chcon -p uu_runcon --target-dir /tmp/pr-bug-test
Compiling uu_runcon v0.8.0
Compiling uu_chcon v0.8.0
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.64s
$ echo $?
0
$ ls /tmp/pr-bug-test/debug/chcon /tmp/pr-bug-test/debug/runcon
ls: /tmp/pr-bug-test/debug/chcon: No such file or directory
ls: /tmp/pr-bug-test/debug/runcon: No such file or directorySo warning: target filter `bins` specified, but no targets matched; this is a no-op
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.12sAfter my fix, the same build produces both binaries, and running them gives the intended stub error: $ cargo build -p uu_chcon -p uu_runcon --target-dir /tmp/pr-fix-test
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.00s
$ ls /tmp/pr-fix-test/debug/chcon /tmp/pr-fix-test/debug/runcon
/tmp/pr-fix-test/debug/chcon
/tmp/pr-fix-test/debug/runcon
$ /tmp/pr-fix-test/debug/chcon
chcon: SELinux is not supported on this platform
$ /tmp/pr-fix-test/debug/runcon
runcon: SELinux is not supported on this platformu can cherry-pick my commit if you want: |
|
GNU no linger build them by default.
For example, Arch's coreutils package does not have them.
Also eprintln! only stubs are not useful for compatibility for scripts.
|
|
agree reproduce is only meant to show the Cargo failure mode: with so the question is policy:
my commit implements the second option |
|
hmm, my concern is enterprise or pkg determinism. uutils is not just a toy replacement, it targets serious distro/server use, including Ubuntu integration and cross-platform coreutils compatibility |
|
Upstream (GNU) sometimes do breaking change if they considered they should do that. In my opinion, consumers should be changed too in those cases. |
|
Option 2 is sometimes not ideal. If we published So I prefer |
Closes #12320
Contributes to #12394
Contributes to #4400
Avoid building
chconandrunconwhenfeat_selinuxis not enabled.Context: #8795, #10360
cc: @naoNao89