Skip to content

Commit

Permalink
Clear RUSTC_WRAPPER when running build scripts
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
davidlattimore committed Aug 3, 2024
1 parent 9320197 commit 9342a8b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/proxy/subprocess.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,14 @@ fn proxy_binary(
let Some(sandbox) = crate::sandbox::for_perm_sel(&sandbox_config, &orig_bin, &perm_sel)?
else {
// Config says to run without a sandbox.
return Ok(command.args(args).status()?.into());
return Ok(command
// If the command is a build script and it runs rustc, we want it to invoke rustc
// directly, not to go via our wrapper. This is also consistent with what happens if
// the command were to be run in a sandbox.
.env_remove("RUSTC_WRAPPER")
.args(args)
.status()?
.into());
};

let output = sandbox.run(&command)?;
Expand Down

0 comments on commit 9342a8b

Please sign in to comment.