Skip to content

refactor: add cfg aliases - #11016

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

xtqqczze wants to merge 11 commits into
uutils:mainfrom
xtqqczze:cfg_aliases/selinux

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Feb 18, 2026 •

Copy link
Copy Markdown
Collaborator

No description provided.

@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

@sylvestre sylvestre left a comment

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.

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

@xtqqczze

Copy link
Copy Markdown
Collaborator 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

xtqqczze commented Feb 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

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
Collaborator 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

xtqqczze commented Feb 19, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

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

@oech3

oech3 commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

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

xtqqczze commented Apr 3, 2026 •

Copy link
Copy Markdown
Collaborator Author

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

Annoyingly, this didn't work.

@github-actions

github-actions Bot commented Apr 3, 2026

Copy link
Copy Markdown

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

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

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

github-actions Bot commented Apr 4, 2026

Copy link
Copy Markdown

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

oech3 commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

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

@xtqqczze

Copy link
Copy Markdown
Collaborator 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.

@xtqqczze

Copy link
Copy Markdown
Collaborator Author

@sylvestre I don't have triage permission so am unable to reopen.

@oech3

oech3 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

I don't want to have 100+ diff just for simple cfg without cargo itself's help.

@cakebaker cakebaker reopened this Sep 20, 2026
@xtqqczze

Copy link
Copy Markdown
Collaborator Author

I will look into an alternative solution, e.g. https://crates.io/crates/crossfig.

@xtqqczze

This comment was marked as outdated.

@xtqqczze
xtqqczze marked this pull request as ready for review September 27, 2026 09:04
@xtqqczze

Copy link
Copy Markdown
Collaborator Author

@sylvestre Actually, I don't think we should move the alias definitions to a common location. They depend on features defined by each crate (e.g. selinux), so a shared definition would have to assume those features exist everywhere. That would couple the common layer to crate-specific feature names.

@xtqqczze
xtqqczze force-pushed the cfg_aliases/selinux branch 2 times, most recently from 6140912 to 39cf1c6 Compare September 28, 2026 14:02
@xtqqczze
xtqqczze requested a review from sylvestre September 28, 2026 17:39
@xtqqczze
xtqqczze force-pushed the cfg_aliases/selinux branch from 39cf1c6 to 42dd93a Compare October 5, 2026 10:54

This branch has not been deployed

No deployments
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.

4 participants