Conversation
|
Binary size comparison: |
|
GNU testsuite comparison: |
| )); | ||
| } | ||
| // GNU traces only the unsets that remove something | ||
| if opts.debug && env::var_os(name).is_some() { |
There was a problem hiding this comment.
GNU prints unset: unconditionally, even for a variable that isn't set or an invalid name
| assert_eq!(result.stderr_str(), "unset: ENV_VERBOSE_UNSET_ME\n"); | ||
|
|
||
| // unsetting a variable that does not exist is not traced | ||
| let result = new_ucmd!() |
There was a problem hiding this comment.
GNU does trace it. Should expect unset: ENV_VERBOSE_NOT_SET
| ); | ||
| continue; | ||
| } | ||
| if opts.debug { |
There was a problem hiding this comment.
to_string_lossy() mangles non-UTF-8 args - GNU passes the raw bytes through. Write the OsStr bytes to stderr instead. Same at line 1065.
450d95a to
85d29c9
Compare
85d29c9 to
5abae63
Compare
|
@sylvestre ready |
5abae63 to
a1d927e
Compare
a1d927e to
162d6b9
Compare
Merging this PR will degrade performance by 4.97%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | three_39_bit_primes |
684.4 ms | 779.3 ms | -12.18% |
| ❌ | Simulation | five_38_bit_primes |
1.7 s | 1.9 s | -6.42% |
| ⚡ | Simulation | thirteen_39_bit_primes |
9.3 s | 8.9 s | +4.42% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing wtcpython:env-verbose-trace (18dea1f) with main (5b2e6e0)
Footnotes
-
54 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. ↩
162d6b9 to
63dbf12
Compare
63dbf12 to
a830bd5
Compare
a830bd5 to
d032fa3
Compare
d032fa3 to
2627c89
Compare
2627c89 to
b0a440f
Compare
b0a440f to
0b3c950
Compare
0b3c950 to
eea75bb
Compare
eea75bb to
834c47e
Compare
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
| fn apply_unset_env_vars(opts: &Options<'_>) -> Result<(), Box<dyn UError>> { | ||
| for name in &opts.unsets { | ||
| if opts.debug { | ||
| let mut error = stderr().lock(); | ||
| let _ = error.write_all(b"unset: "); | ||
| let _ = error.write_all_os(name); | ||
| let _ = error.write_all(b"\n"); | ||
| } | ||
| let native_name = NativeStr::new(name); | ||
| if name.is_empty() | ||
| || native_name.contains('\0').unwrap() |
| if opts.debug { | ||
| let mut error = stderr().lock(); | ||
| let _ = writeln!(error, "chdir: {}", d.quote()); | ||
| } | ||
| match env::set_current_dir(d) { | ||
| Ok(()) => d, |
834c47e to
18dea1f
Compare

Fixes #14171.
GNU traces each environment change in verbose mode, and
-vvis just-vrepeated. We printed nothing for
-vand dumped the input args for-vv.Print the same trace lines as GNU (
cleaning environ,setenv,unset,chdir) and drop the argument dump. Add tests for the traced output and for-vvmatching-v.