Skip to content

numfmt: accept unambiguous --from and --invalid prefixes - #16045

Open
Logic769 wants to merge 1 commit into
uutils:mainfrom
Logic769:numfmt-abbreviated-modes
Open

Logic769 wants to merge 1 commit into
uutils:mainfrom
Logic769:numfmt-abbreviated-modes

Conversation

@Logic769

Copy link
Copy Markdown
Contributor

GNU numfmt matches enumerated option values by any unambiguous prefix, so
--from=a selects auto and --invalid=a selects abort. uutils rejected
such values because --from only compared exact strings and --invalid used a
fixed clap list.

A shared match_enum_value helper now resolves a value by exact name first and
then by a unique prefix. --from, --to and --invalid use it, so
--from=i stays an error because it is ambiguous between iec and iec-i,
while --from=iec remains valid.

Tests cover the accepted prefixes for --from and --invalid and the
ambiguous --from=i case.

Closes #16005

@sylvestre

Copy link
Copy Markdown
Contributor

@Logic769 as I asked you many time to stop pushing a lot of patches and you ignored me, i have no other solutions than to block you temporarily.

@xtqqczze

Copy link
Copy Markdown
Collaborator

@Logic769 If you have already opened a PR for the work, continue working on that PR rather than opening a new one to replace it.

@Logic769
Logic769 force-pushed the numfmt-abbreviated-modes branch 2 times, most recently from 8a3b5fc to 87ac891 Compare November 3, 2026 15:41
@Logic769

Logic769 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

CI failure analysis

Failure

The Tests job (126023407306) fails while building the uucore test target:

error: failed to determine package fingerprint for build script for uucore v0.13.0
Caused by:
  failed to determine the most recently modified file in .../src/uucore
Caused by:
  Failed to read the directory at '.../src/uucore/uucore_fs_test_neq_8'
Caused by:
  No such file or directory (os error 2)

Reason

The failing path is the temporary directory src/uucore/uucore_fs_test_neq_8, which is created and removed by the parallel filesystem tests under src/uucore. Cargo scans that same directory to compute the uucore build-script fingerprint, so the scan can race with the test cleanup and hit ENOENT. The later missing-rlib and doctest errors are consequences of this build-script scan failure.

This is a test-directory race in the uucore test setup, not a failure in the numfmt changes in this PR. The same signature is present on unrelated PRs, and no code change in this PR is needed for this failure; rerunning the failed job should clear it.

@Logic769

Logic769 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Failure

The Tests job (126349767107) failed while building the uucore test target:

error: failed to determine package fingerprint for build script for uucore v0.13.0
Caused by:
  failed to determine the most recently modified file in .../src/uucore
Caused by:
  Failed to read the directory at '.../src/uucore/uucore_fs_test_eq_hl_5'
Caused by:
  No such file or directory (os error 2)

Reason

This is the same uucore_fs_test_* temporary-directory race as the previous run (job 126023407306): parallel filesystem tests create and remove a directory under src/uucore while cargo computes the build-script fingerprint. It is unrelated to the numfmt changes. Please rerun the job.

@sylvestre
sylvestre force-pushed the numfmt-abbreviated-modes branch from 87ac891 to 1ebd59b Compare November 6, 2026 11:20
@Logic769
Logic769 force-pushed the numfmt-abbreviated-modes branch from 1ebd59b to d562471 Compare November 16, 2026 04:12
@sylvestre
sylvestre force-pushed the numfmt-abbreviated-modes branch from d562471 to e427709 Compare November 16, 2026 19:48
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

GNU testsuite comparison:

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 numfmt-abbreviated-modes branch from e427709 to f2bc6d9 Compare November 18, 2026 04:38
@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 numfmt-abbreviated-modes branch from f2bc6d9 to 2528232 Compare November 19, 2026 11:57

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.

numfmt: --from / --invalid do not accept unambiguous abbreviations

3 participants