Skip to content

Commit 723f6f7

Browse files
committed
fix(valgrind): skip rustup-wrapped proxy in trace-children
Valgrind rewrites argv[0] when tracing Nix's rustup wrapper, breaking rustup proxy detection. Add *.rustup-wrapped to --trace-children-skip.
1 parent 2298ed2 commit 723f6f7

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/executor/valgrind/measure.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ fn get_valgrind_args(tool: &SimulationTool, config: &ExecutorConfig) -> Vec<Stri
4646
}
4747
}
4848

49-
let children_skip_patterns = ["*esbuild"];
49+
// Valgrind changes argv[0] when tracing Nix's rustup wrapper, which breaks rustup proxy detection.
50+
let children_skip_patterns = ["*esbuild", "*.rustup-wrapped"];
5051
args.push(format!(
5152
"--trace-children-skip={}",
5253
children_skip_patterns.join(",")
@@ -235,6 +236,18 @@ mod tests {
235236
(script_status, out_status)
236237
}
237238

239+
#[test]
240+
fn test_valgrind_skips_rustup_wrapped_proxy() {
241+
let config = ExecutorConfig::test();
242+
let args = get_valgrind_args(&SimulationTool::Callgrind, &config);
243+
let skip_arg = args
244+
.iter()
245+
.find(|arg| arg.starts_with("--trace-children-skip="))
246+
.unwrap();
247+
248+
assert!(skip_arg.contains("*.rustup-wrapped"));
249+
}
250+
238251
#[test]
239252
fn test_run_wrapper_script() {
240253
temp_env::with_var("TEST_ENV_VAR", "test_value".into(), || {

0 commit comments

Comments
 (0)