diff options
| author | Ralf Jung <post@ralfj.de> | 2024-04-16 08:52:06 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-04-16 08:52:36 +0200 |
| commit | 876ac7b1c3fcd99b06a3170bd4abdc7e3317a005 (patch) | |
| tree | 9fdb9f5900625440fe3f0254a2b6e2bab5886bff | |
| parent | 2f08c2c96501990caab0e47a095d76ffd6a31f16 (diff) | |
| download | rust-876ac7b1c3fcd99b06a3170bd4abdc7e3317a005.tar.gz rust-876ac7b1c3fcd99b06a3170bd4abdc7e3317a005.zip | |
avoid passing --sysroot twice in bootstrap
| -rw-r--r-- | src/tools/miri/cargo-miri/src/phases.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/tools/miri/cargo-miri/src/phases.rs b/src/tools/miri/cargo-miri/src/phases.rs index ca8b35a17be..b774ca8fa72 100644 --- a/src/tools/miri/cargo-miri/src/phases.rs +++ b/src/tools/miri/cargo-miri/src/phases.rs @@ -412,8 +412,11 @@ pub fn phase_rustc(mut args: impl Iterator<Item = String>, phase: RustcPhase) { // Arguments are treated very differently depending on whether this crate is // for interpretation by Miri, or for use by a build script / proc macro. if target_crate { - // Set the sysroot. - cmd.arg("--sysroot").arg(env::var_os("MIRI_SYSROOT").unwrap()); + if phase != RustcPhase::Setup { + // Set the sysroot -- except during setup, where we don't have an existing sysroot yet + // and where the bootstrap wrapper adds its own `--sysroot` flag so we can't set ours. + cmd.arg("--sysroot").arg(env::var_os("MIRI_SYSROOT").unwrap()); + } // Forward arguments, but patched. let emit_flag = "--emit"; @@ -578,9 +581,9 @@ pub fn phase_runner(mut binary_args: impl Iterator<Item = String>, phase: Runner } if phase != RunnerPhase::Rustdoc { - // Set the sysroot. Not necessary in rustdoc, where we already set the sysroot when invoking - // rustdoc itself, which will forward that flag when invoking rustc (i.e., us), so the flag - // is present in `info.args`. + // Set the sysroot. Not necessary in rustdoc, where we already set the sysroot in + // `phase_rustdoc`. rustdoc will forward that flag when invoking rustc (i.e., us), so the + // flag is present in `info.args`. cmd.arg("--sysroot").arg(env::var_os("MIRI_SYSROOT").unwrap()); } // Forward rustc arguments. |
