File tree 3 files changed +8
-8
lines changed
3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ pub(crate) fn build_sysroot(
53
53
spawn_and_wait ( build_cargo_wrapper_cmd) ;
54
54
}
55
55
56
- let default_sysroot = super :: rustc_info:: get_default_sysroot ( ) ;
56
+ let default_sysroot = super :: rustc_info:: get_default_sysroot ( & bootstrap_host_compiler . rustc ) ;
57
57
58
58
let host_rustlib_lib =
59
59
RUSTLIB_DIR . to_path ( dirs) . join ( & bootstrap_host_compiler. triple ) . join ( "lib" ) ;
@@ -182,7 +182,7 @@ fn build_clif_sysroot_for_triple(
182
182
process:: exit ( 1 ) ;
183
183
}
184
184
Ok ( source_version) => {
185
- let rustc_version = get_rustc_version ( ) ;
185
+ let rustc_version = get_rustc_version ( & compiler . rustc ) ;
186
186
if source_version != rustc_version {
187
187
eprintln ! ( "The patched sysroot source is outdated" ) ;
188
188
eprintln ! ( "Source version: {}" , source_version. trim( ) ) ;
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ pub(crate) fn prepare(dirs: &Dirs) {
35
35
}
36
36
37
37
fn prepare_sysroot ( dirs : & Dirs ) {
38
- let sysroot_src_orig = get_default_sysroot ( ) . join ( "lib/rustlib/src/rust" ) ;
38
+ let sysroot_src_orig = get_default_sysroot ( Path :: new ( "rustc" ) ) . join ( "lib/rustlib/src/rust" ) ;
39
39
assert ! ( sysroot_src_orig. exists( ) ) ;
40
40
41
41
eprintln ! ( "[COPY] sysroot src" ) ;
@@ -50,7 +50,7 @@ fn prepare_sysroot(dirs: &Dirs) {
50
50
& SYSROOT_SRC . to_path ( dirs) . join ( "library" ) ,
51
51
) ;
52
52
53
- let rustc_version = get_rustc_version ( ) ;
53
+ let rustc_version = get_rustc_version ( Path :: new ( "rustc" ) ) ;
54
54
fs:: write ( SYSROOT_RUSTC_VERSION . to_path ( dirs) , & rustc_version) . unwrap ( ) ;
55
55
56
56
eprintln ! ( "[GIT] init" ) ;
Original file line number Diff line number Diff line change 1
1
use std:: path:: { Path , PathBuf } ;
2
2
use std:: process:: { Command , Stdio } ;
3
3
4
- pub ( crate ) fn get_rustc_version ( ) -> String {
4
+ pub ( crate ) fn get_rustc_version ( rustc : & Path ) -> String {
5
5
let version_info =
6
- Command :: new ( " rustc" ) . stderr ( Stdio :: inherit ( ) ) . args ( & [ "-V" ] ) . output ( ) . unwrap ( ) . stdout ;
6
+ Command :: new ( rustc) . stderr ( Stdio :: inherit ( ) ) . args ( & [ "-V" ] ) . output ( ) . unwrap ( ) . stdout ;
7
7
String :: from_utf8 ( version_info) . unwrap ( )
8
8
}
9
9
@@ -53,8 +53,8 @@ pub(crate) fn get_rustdoc_path() -> PathBuf {
53
53
Path :: new ( String :: from_utf8 ( rustc_path) . unwrap ( ) . trim ( ) ) . to_owned ( )
54
54
}
55
55
56
- pub ( crate ) fn get_default_sysroot ( ) -> PathBuf {
57
- let default_sysroot = Command :: new ( " rustc" )
56
+ pub ( crate ) fn get_default_sysroot ( rustc : & Path ) -> PathBuf {
57
+ let default_sysroot = Command :: new ( rustc)
58
58
. stderr ( Stdio :: inherit ( ) )
59
59
. args ( & [ "--print" , "sysroot" ] )
60
60
. output ( )
You can’t perform that action at this time.
0 commit comments