Skip to content

Commit 611340f

Browse files
authored
Rollup merge of #141736 - onur-ozkan:resolve-stage0-syroot-from-rustc, r=Kobzol
resolve stage0 sysroot from rustc Similar to #141729, instead of manually navigating directories based on stage0 rustc, use `--print sysroot` to get the sysroot directly. This also works when using the bootstrap `rustc` shim. r? Kobzol
2 parents c61a1e0 + 0565d43 commit 611340f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/bootstrap/src/core/config/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1832,7 +1832,9 @@ impl Config {
18321832
.join(exe("rustc", config.build))
18331833
};
18341834

1835-
config.initial_sysroot = config.initial_rustc.ancestors().nth(2).unwrap().into();
1835+
config.initial_sysroot = t!(PathBuf::from_str(
1836+
output(Command::new(&config.initial_rustc).args(["--print", "sysroot"])).trim()
1837+
));
18361838

18371839
config.initial_cargo_clippy = cargo_clippy;
18381840

0 commit comments

Comments
 (0)