File tree 2 files changed +12
-4
lines changed
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -1099,10 +1099,11 @@ impl Step for Sysroot {
1099
1099
/// 1-3.
1100
1100
fn run ( self , builder : & Builder < ' _ > ) -> Interned < PathBuf > {
1101
1101
let compiler = self . compiler ;
1102
+ let host_dir = builder. out . join ( & compiler. host . triple ) ;
1102
1103
let sysroot = if compiler. stage == 0 {
1103
- builder . out . join ( & compiler . host . triple ) . join ( "stage0-sysroot" )
1104
+ host_dir . join ( "stage0-sysroot" )
1104
1105
} else {
1105
- builder . out . join ( & compiler . host . triple ) . join ( format ! ( "stage{}" , compiler. stage) )
1106
+ host_dir . join ( format ! ( "stage{}" , compiler. stage) )
1106
1107
} ;
1107
1108
let _ = fs:: remove_dir_all ( & sysroot) ;
1108
1109
t ! ( fs:: create_dir_all( & sysroot) ) ;
@@ -1113,6 +1114,11 @@ impl Step for Sysroot {
1113
1114
builder. config. build, compiler. host,
1114
1115
"Cross-compiling is not yet supported with `download-rustc`" ,
1115
1116
) ;
1117
+
1118
+ // #102002, cleanup stage1 and stage0-sysroot folders when using download-rustc
1119
+ let _ = fs:: remove_dir_all ( host_dir. join ( "stage1" ) ) ;
1120
+ let _ = fs:: remove_dir_all ( host_dir. join ( "stage0-sysroot" ) ) ;
1121
+
1116
1122
// Copy the compiler into the correct sysroot.
1117
1123
let ci_rustc_dir =
1118
1124
builder. config . out . join ( & * builder. config . build . triple ) . join ( "ci-rustc" ) ;
Original file line number Diff line number Diff line change @@ -512,8 +512,10 @@ impl Step for Rustdoc {
512
512
// Similar to `compile::Assemble`, build with the previous stage's compiler. Otherwise
513
513
// we'd have stageN/bin/rustc and stageN/bin/rustdoc be effectively different stage
514
514
// compilers, which isn't what we want. Rustdoc should be linked in the same way as the
515
- // rustc compiler it's paired with, so it must be built with the previous stage compiler.
516
- let build_compiler = builder. compiler ( target_compiler. stage - 1 , builder. config . build ) ;
515
+ // rustc compiler it's paired with, so it must be built with the previous stage compiler,
516
+ // if download_rustc is true, we will use the same target stage.
517
+ let target_stage = target_compiler. stage - if builder. download_rustc ( ) { 0 } else { 1 } ;
518
+ let build_compiler = builder. compiler ( target_stage, builder. config . build ) ;
517
519
518
520
// When using `download-rustc` and a stage0 build_compiler, copying rustc doesn't actually
519
521
// build stage0 libstd (because the libstd in sysroot has the wrong ABI). Explicitly build
You can’t perform that action at this time.
0 commit comments