Skip to content

deps: gate selinux-related dependency set behind feat_selinux#12395

Draft
xtqqczze wants to merge 1 commit into
uutils:mainfrom
xtqqczze:features-feat_selinux
Draft

deps: gate selinux-related dependency set behind feat_selinux#12395
xtqqczze wants to merge 1 commit into
uutils:mainfrom
xtqqczze:features-feat_selinux

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

@xtqqczze xtqqczze commented May 19, 2026

Follow-up #10360

The purpose of this change is to avoid pulling in Linux-specific dependencies such as selinux-sys when feat_selinux is not enabled, addressing the following TODO:

# TODO: block fetching crates without feat_selinux

@xtqqczze xtqqczze force-pushed the features-feat_selinux branch 2 times, most recently from b21169d to f2bc7bb Compare May 20, 2026 00:04
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 20, 2026

Merging this PR will not alter performance

✅ 319 untouched benchmarks
⏩ 46 skipped benchmarks1


Comparing xtqqczze:features-feat_selinux (a41da3b) with main (bd908f0)

Open in CodSpeed

Footnotes

  1. 46 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
Copy Markdown

github-actions Bot commented May 20, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/tail-n0f (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/cut/cut-huge-range is now passing!

Comment thread build.rs Outdated
#[allow(clippy::match_same_arms)]
match krate.as_ref() {
#[cfg(not(any(target_os = "linux", target_os = "android")))]
#[cfg(not(all(
Copy link
Copy Markdown
Contributor Author

@xtqqczze xtqqczze May 20, 2026

Choose a reason for hiding this comment

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

@cakebaker @oech3 This doesn't seem to be correct approach in build.rs, any ideas?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't think cargo itself has solution satisfying everyone's requirements.

Someone might hope to see error with invalid combination of features (e.g, feat_selinux on macOS).

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.

#[cfg(...)] attributes are evaluated at compile time, but build.rs is compiled for and executed on the host machine, not the final target...

@xtqqczze xtqqczze force-pushed the features-feat_selinux branch 3 times, most recently from 6bc9027 to b1ad705 Compare May 20, 2026 23:14
@xtqqczze xtqqczze force-pushed the features-feat_selinux branch from b1ad705 to a41da3b Compare May 21, 2026 11:23
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