Skip to content

env: GNU-compatibility fixes#11512

Open
can1357 wants to merge 6 commits intouutils:mainfrom
can1357:env-gnu-compat
Open

env: GNU-compatibility fixes#11512
can1357 wants to merge 6 commits intouutils:mainfrom
can1357:env-gnu-compat

Conversation

@can1357
Copy link
Copy Markdown
Contributor

@can1357 can1357 commented Mar 26, 2026

-S accepts non-GNU variable expansion (${FOO:-default}, $FOO)

GNU only allows ${VARNAME} in env -S; anything else errors. uutils accepts extra forms and expands them into argv, so invalid input that should fail can still run.

-C/--chdir runs too early

uutils does chdir before env/signal setup. GNU does env/signal setup first, then chdir right before exec. So with -C + env/config flags, behavior differs and uutils can fail earlier in a different directory context.

-S/--split-string option forms are misparsed and can change argv

uutils pre-parses -S/--split-string in a non-standard way. -S ARG / --split-string ARG can act like empty payload, and --split-string=ARG can tokenize with leading =.

env --split-string="printf Y:%s\\n three"
GNU: Y:three
uutils: malformed parse + exec fail (127)

-S rejects backslashes in single quotes that GNU treats literally

In single quotes, GNU keeps backslashes literal (except \\ and \'). uutils errors on sequences like \a with 125.

env -S"printf %s '\''\\x'\''"
GNU: prints \x
uutils: invalid sequence '\x' in -S (125)

@github-actions
Copy link
Copy Markdown

GNU testsuite comparison:

GNU test failed: tests/env/env-S. tests/env/env-S is passing on 'main'. Maybe you have to rebase?
Skipping an intermittent issue tests/date/date-locale-hour (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/csplit/csplit-heap is now being skipped but was previously passing.
Note: The gnu test tests/cut/bounded-memory is now being skipped but was previously passing.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 26, 2026

Merging this PR will not alter performance

✅ 309 untouched benchmarks
⏩ 46 skipped benchmarks1


Comparing can1357:env-gnu-compat (e1fb25e) with main (252ec26)

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.

@can1357 can1357 marked this pull request as ready for review April 8, 2026 07:39
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 8, 2026

GNU testsuite comparison:

GNU test failed: tests/env/env-S. tests/env/env-S is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/pr/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/symlink (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)
Note: The gnu test tests/tail/tail-n0f is now being skipped but was previously passing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants