env: support --env0-from - #14609
Open
wtcpython wants to merge 1 commit into
Open
env: support --env0-from#14609wtcpython wants to merge 1 commit into
wtcpython wants to merge 1 commit into
Conversation
wtcpython
force-pushed
the
env-env0-from
branch
from
September 17, 2026 01:40
d9c06ce to
1f30a20
Compare
wtcpython
marked this pull request as ready for review
September 17, 2026 01:40
|
GNU testsuite comparison: |
Contributor
|
#14626 was submitted at 1st |
wtcpython
force-pushed
the
env-env0-from
branch
from
September 17, 2026 13:27
1f30a20 to
02d6bdb
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 20, 2026 14:33
9251dbe to
95b3b13
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 21, 2026 00:34
95b3b13 to
6f59050
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 21, 2026 06:22
6f59050 to
6632dee
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 21, 2026 06:51
6632dee to
c05e0c4
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 21, 2026 07:13
c05e0c4 to
d7b7c92
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 23, 2026 00:27
d7b7c92 to
5aa10c7
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 25, 2026 00:56
5aa10c7 to
e9c0b1d
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 27, 2026 00:39
e9c0b1d to
8f80bf8
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 29, 2026 06:09
8f80bf8 to
d6ffe2c
Compare
cakebaker
reviewed
Sep 29, 2026
| .succeeds() | ||
| .stdout_move_str(); | ||
|
|
||
| assert!(!out.lines().any(|line| line == "UU_ENV0_OPAQUE_14609")); |
Contributor
There was a problem hiding this comment.
I think the assert should be without negation. If I manually run the command with GNU env (printf "UU_ENV0_OPAQUE_14609\0" | env --env0-from=-), the string shows up in the list.
wtcpython
force-pushed
the
env-env0-from
branch
from
September 29, 2026 08:55
d6ffe2c to
b32ed9d
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 29, 2026 09:24
b32ed9d to
d50b48a
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 29, 2026 11:22
d50b48a to
90fce30
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
September 30, 2026 03:20
90fce30 to
99e2977
Compare
wtcpython
force-pushed
the
env-env0-from
branch
from
October 1, 2026 11:40
99e2977 to
7b15a3b
Compare
Contributor
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 2
Open (4)
This loop dereferencesptr(*ptr) without first checking whetherptritself is null. If… · New Temporarily overwriting the globalenvironpointer is not thread-safe (it can race with other… · Newentry_keyreturnsSome(&[] )for entries that start with=(i.e., an empty name). Downstream… · New On non-Unix,--env0-fromclears the environment and then silently skips entries that are opaque… · New
Comment on lines
+1050
to
+1061
| unsafe { | ||
| let mut ptr = *environ(); | ||
| while !(*ptr).is_null() { | ||
| let cstr = std::ffi::CStr::from_ptr(*ptr); | ||
| writer.write_all(cstr.to_bytes())?; | ||
| match opts.line_ending { | ||
| LineEnding::Nul => writer.write_all(b"\0")?, | ||
| LineEnding::Newline => writer.write_all(b"\n")?, | ||
| } | ||
| ptr = ptr.add(1); | ||
| } | ||
| } |
Comment on lines
+1165
to
+1169
| let orig = envp_ptrs.as_mut().map(|ptrs| unsafe { | ||
| let p = *environ(); | ||
| *environ() = ptrs.as_mut_ptr(); | ||
| p | ||
| }); |
Comment on lines
+334
to
+337
| entry | ||
| .iter() | ||
| .position(|&b| b == b'=') | ||
| .map(|pos| &entry[..pos]) |
Comment on lines
+1198
to
+1207
| cmd.env_clear(); | ||
| for entry in entries { | ||
| if let Some(key) = entry_key(entry) { | ||
| let val = &entry[key.len() + 1..]; | ||
| if let (Ok(k), Ok(v)) = (std::str::from_utf8(key), std::str::from_utf8(val)) | ||
| { | ||
| cmd.env(k, v); | ||
| } | ||
| } | ||
| } |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Closes #14602.
Support
--env0-from=FILEto read environment variables from a NUL-delimited file, matching GNUenv9.12.Should make test tests/env/env0-from.sh pass