Repository navigation
Conversation
b21169d to
f2bc7bb
Compare
Merging this PR will not alter performance
|
|
GNU testsuite comparison: |
a785135 to
5951317
Compare
f3e11b8 to
b6c7276
Compare
This comment was marked as resolved.
This comment was marked as resolved.
|
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 |
60f4a32 to
cc27276
Compare
This comment was marked as outdated.
This comment was marked as outdated.
38e066c to
3e45466
Compare
3e45466 to
9d641e1
Compare
|
In my understanding, there is nothing we can do for |
c5ec08c to
3ab7755
Compare
With these changes: $ rustc --print host-tuple
aarch64-apple-darwin
$ cargo check -p uu_runcon --bins --target x86_64-unknown-linux-gnu
warning: target filter `bins` specified, but no targets matched; this is a no-op
Finished `dev` profile [unoptimized] target(s) in 0.51sBecause the |
7f0bcc2 to
3f4d178
Compare
|
I don't have priv to merge. @cakebaker Would you review this? |
3f4d178 to
e25af34
Compare
e25af34 to
8fd0030
Compare
8fd0030 to
e82920e
Compare
Closes #12320
Contributes to #12394
Contributes to #4400
Summary
Avoid building
chconandrunconbinaries when theselinuxfeature is not enabled.Both utilities depend on SELinux support, so they should not be included in builds that do not enable the corresponding feature. Using Cargo’s
required-featuresmechanism makes this dependency explicit at the binary target level and prevents these targets from being built when SELinux support is unavailable.This also avoids the previous approach of using
compile_error!to prevent unsupported binaries from being distributed. While that approach catches the problem at compile time, it also makes otherwise valid operations such ascargo checkfail when theselinuxfeature is disabled.Alternatives considered
compile_error!: This preventschconandrunconfrom being compiled without SELinux support, but also causes commands such ascargo checkto fail for configurations whereselinuxis disabled.required-features: This is the approach taken here. It expresses the dependency at the binary-target level and lets Cargo skipchconandrunconentirely whenselinuxis disabled.Context