Skip to content

Commit 8d5e856

Browse files
committed
Allow overwriting the sysroot compile flag via --rustc-args
1 parent a77659a commit 8d5e856

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1951,7 +1951,9 @@ impl<'test> TestCx<'test> {
19511951
rustc.arg("-Ztranslate-remapped-path-to-local-path=no");
19521952

19531953
// Optionally prevent default --sysroot if specified in test compile-flags.
1954-
if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot")) {
1954+
if !self.props.compile_flags.iter().any(|flag| flag.starts_with("--sysroot"))
1955+
&& !self.config.host_rustcflags.iter().any(|flag| flag == "--sysroot")
1956+
{
19551957
// In stage 0, make sure we use `stage0-sysroot` instead of the bootstrap sysroot.
19561958
rustc.arg("--sysroot").arg(&self.config.sysroot_base);
19571959
}

0 commit comments

Comments
 (0)