@@ -10,9 +10,9 @@ use crate::utils::{
10
10
} ;
11
11
use crate :: { config, CodegenBackend , SysrootKind } ;
12
12
13
- static DIST_DIR : RelPath = RelPath :: DIST ;
14
- static BIN_DIR : RelPath = RelPath :: DIST . join ( "bin" ) ;
15
- static LIB_DIR : RelPath = RelPath :: DIST . join ( "lib" ) ;
13
+ static DIST_DIR : RelPath = RelPath :: dist ( "." ) ;
14
+ static BIN_DIR : RelPath = RelPath :: dist ( "bin" ) ;
15
+ static LIB_DIR : RelPath = RelPath :: dist ( "lib" ) ;
16
16
17
17
pub ( crate ) fn build_sysroot (
18
18
dirs : & Dirs ,
@@ -26,9 +26,10 @@ pub(crate) fn build_sysroot(
26
26
27
27
eprintln ! ( "[BUILD] sysroot {:?}" , sysroot_kind) ;
28
28
29
- DIST_DIR . ensure_fresh ( dirs) ;
30
- BIN_DIR . ensure_exists ( dirs) ;
31
- LIB_DIR . ensure_exists ( dirs) ;
29
+ remove_dir_if_exists ( & dirs. dist_dir ) ;
30
+ fs:: create_dir_all ( & dirs. dist_dir ) . unwrap ( ) ;
31
+ fs:: create_dir_all ( BIN_DIR . to_path ( dirs) ) . unwrap ( ) ;
32
+ fs:: create_dir_all ( LIB_DIR . to_path ( dirs) ) . unwrap ( ) ;
32
33
33
34
let is_native = bootstrap_host_compiler. triple == target_triple;
34
35
@@ -58,7 +59,7 @@ pub(crate) fn build_sysroot(
58
59
let mut build_cargo_wrapper_cmd = Command :: new ( & bootstrap_host_compiler. rustc ) ;
59
60
let wrapper_path = DIST_DIR . to_path ( dirs) . join ( & wrapper_name) ;
60
61
build_cargo_wrapper_cmd
61
- . arg ( RelPath :: SCRIPTS . to_path ( dirs ) . join ( & format ! ( "{wrapper}.rs" ) ) )
62
+ . arg ( dirs . source_dir . join ( "scripts" ) . join ( & format ! ( "{wrapper}.rs" ) ) )
62
63
. arg ( "-o" )
63
64
. arg ( & wrapper_path)
64
65
. arg ( "-Cstrip=debuginfo" ) ;
@@ -116,10 +117,8 @@ pub(crate) fn build_sysroot(
116
117
117
118
let mut target_compiler = {
118
119
let dirs: & Dirs = & dirs;
119
- let rustc_clif =
120
- RelPath :: DIST . to_path ( & dirs) . join ( wrapper_base_name. replace ( "____" , "rustc-clif" ) ) ;
121
- let rustdoc_clif =
122
- RelPath :: DIST . to_path ( & dirs) . join ( wrapper_base_name. replace ( "____" , "rustdoc-clif" ) ) ;
120
+ let rustc_clif = dirs. dist_dir . join ( wrapper_base_name. replace ( "____" , "rustc-clif" ) ) ;
121
+ let rustdoc_clif = dirs. dist_dir . join ( wrapper_base_name. replace ( "____" , "rustdoc-clif" ) ) ;
123
122
124
123
Compiler {
125
124
cargo : bootstrap_host_compiler. cargo . clone ( ) ,
@@ -158,10 +157,10 @@ impl SysrootTarget {
158
157
}
159
158
}
160
159
161
- static STDLIB_SRC : RelPath = RelPath :: BUILD . join ( "stdlib" ) ;
160
+ static STDLIB_SRC : RelPath = RelPath :: build ( "stdlib" ) ;
162
161
static STANDARD_LIBRARY : CargoProject =
163
- CargoProject :: new ( & STDLIB_SRC . join ( " library/sysroot") , "stdlib_target" ) ;
164
- static RTSTARTUP_SYSROOT : RelPath = RelPath :: BUILD . join ( "rtstartup" ) ;
162
+ CargoProject :: new ( & RelPath :: build ( "stdlib/ library/sysroot") , "stdlib_target" ) ;
163
+ static RTSTARTUP_SYSROOT : RelPath = RelPath :: build ( "rtstartup" ) ;
165
164
166
165
fn build_sysroot_for_triple (
167
166
dirs : & Dirs ,
0 commit comments