@@ -9,19 +9,19 @@ use super::rustc_info::{get_default_sysroot, get_rustc_version};
9
9
use super :: tests:: LIBCORE_TESTS_SRC ;
10
10
use super :: utils:: { copy_dir_recursively, git_command, retry_spawn_and_wait, spawn_and_wait} ;
11
11
12
- pub ( crate ) fn prepare ( dirs : & Dirs ) {
12
+ pub ( crate ) fn prepare ( dirs : & Dirs , rustc : & Path ) {
13
13
RelPath :: DOWNLOAD . ensure_fresh ( dirs) ;
14
14
15
- prepare_stdlib ( dirs) ;
16
- prepare_coretests ( dirs) ;
15
+ prepare_stdlib ( dirs, rustc ) ;
16
+ prepare_coretests ( dirs, rustc ) ;
17
17
18
18
super :: tests:: RAND_REPO . fetch ( dirs) ;
19
19
super :: tests:: REGEX_REPO . fetch ( dirs) ;
20
20
super :: tests:: PORTABLE_SIMD_REPO . fetch ( dirs) ;
21
21
}
22
22
23
- fn prepare_stdlib ( dirs : & Dirs ) {
24
- let sysroot_src_orig = get_default_sysroot ( Path :: new ( " rustc" ) ) . join ( "lib/rustlib/src/rust" ) ;
23
+ fn prepare_stdlib ( dirs : & Dirs , rustc : & Path ) {
24
+ let sysroot_src_orig = get_default_sysroot ( rustc) . join ( "lib/rustlib/src/rust" ) ;
25
25
assert ! ( sysroot_src_orig. exists( ) ) ;
26
26
27
27
eprintln ! ( "[COPY] stdlib src" ) ;
@@ -36,7 +36,7 @@ fn prepare_stdlib(dirs: &Dirs) {
36
36
& SYSROOT_SRC . to_path ( dirs) . join ( "library" ) ,
37
37
) ;
38
38
39
- let rustc_version = get_rustc_version ( Path :: new ( " rustc" ) ) ;
39
+ let rustc_version = get_rustc_version ( rustc) ;
40
40
fs:: write ( SYSROOT_RUSTC_VERSION . to_path ( dirs) , & rustc_version) . unwrap ( ) ;
41
41
42
42
eprintln ! ( "[GIT] init" ) ;
@@ -45,8 +45,8 @@ fn prepare_stdlib(dirs: &Dirs) {
45
45
apply_patches ( dirs, "stdlib" , & SYSROOT_SRC . to_path ( dirs) ) ;
46
46
}
47
47
48
- fn prepare_coretests ( dirs : & Dirs ) {
49
- let sysroot_src_orig = get_default_sysroot ( Path :: new ( " rustc" ) ) . join ( "lib/rustlib/src/rust" ) ;
48
+ fn prepare_coretests ( dirs : & Dirs , rustc : & Path ) {
49
+ let sysroot_src_orig = get_default_sysroot ( rustc) . join ( "lib/rustlib/src/rust" ) ;
50
50
assert ! ( sysroot_src_orig. exists( ) ) ;
51
51
52
52
eprintln ! ( "[COPY] coretests src" ) ;
0 commit comments