Skip to content

mkdir, install: treat bare --context as optional value - #16032

Open
Logic769 wants to merge 7 commits into
uutils:mainfrom
Logic769:mkdir-install-optional-context
Open

Logic769 wants to merge 7 commits into
uutils:mainfrom
Logic769:mkdir-install-optional-context

Conversation

@Logic769

Copy link
Copy Markdown
Contributor

Problem

GNU mkdir --context and install --context take an optional value: a bare --context means "use the default context" and must not consume the following operand as its value. In uutils the next argument was swallowed as the context string.

Change

Make the --context argument accept zero or one value and require = when a value is supplied (num_args(0..=1), require_equals(true), default_missing_value("")), then treat an empty value as "no explicit context string" while still requesting the default context. Added regression tests for both mkdir and install.

Closes #16002

@Logic769
Logic769 force-pushed the mkdir-install-optional-context branch 3 times, most recently from f28718b to 707e843 Compare November 3, 2026 15:43
@sylvestre
sylvestre force-pushed the mkdir-install-optional-context branch from 707e843 to c1f319e Compare November 6, 2026 11:48
@Logic769

Logic769 commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

CI note (infrastructure issue, not related to the change in this PR):

The Tests job failed in the Doc-tests uucore step. The uucore unit tests themselves passed; the doctest compile then failed with error: extern location for ... does not exist: .../target/debug/deps/*.rlib and error[E0463]: can't find crate for ... (27–29 errors). The dependency .rlib files are missing from the restored target cache used by this run. The same failure is currently occurring on several unrelated PRs, so it is a repository CI/cache problem rather than this change. Re-running the job with a fresh build/cache rebuilds the artifacts.

No code changes in this PR are involved.

@sylvestre
sylvestre force-pushed the mkdir-install-optional-context branch from c1f319e to 6c1a48a Compare November 8, 2026 11:08
@sylvestre

Copy link
Copy Markdown
Contributor

sorry but it needs to be rebased

Comment thread src/uu/install/src/install.rs Resolved
Comment thread src/uu/mkdir/src/mkdir.rs Resolved
@Logic769
Logic769 force-pushed the mkdir-install-optional-context branch from 6c1a48a to 6da4f72 Compare November 16, 2026 04:11
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/tail/truncate. tests/tail/truncate is passing on 'main'. Maybe you have to rebase?
Congrats! The gnu test tests/tail/follow-name is no longer failing!
Congrats! The gnu test tests/tail/pid-pipe is no longer failing!

@Logic769
Logic769 force-pushed the mkdir-install-optional-context branch from 6da4f72 to 4914fef Compare November 18, 2026 04:37
@github-actions

Copy link
Copy Markdown

Binary size comparison:

Individual binary size comparison VS main (threshold: >=5% AND >=4 KB).

Total size of compared binaries: 155.49 MB (+108 KB, +0.07%)

Significant per-binary changes:
  env     1.20 MB ->    1.28 MB  (+80 KB, +6.51%)

@sylvestre
sylvestre force-pushed the mkdir-install-optional-context branch from 89e3307 to 9790712 Compare November 19, 2026 10:58

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.

mkdir: --context without a value should be accepted

2 participants