@@ -27,7 +27,6 @@ use crate::config::TargetSelection;
27
27
use crate :: dist;
28
28
use crate :: native;
29
29
use crate :: tool:: SourceType ;
30
- use crate :: use_cached_rustc;
31
30
use crate :: util:: { exe, is_dylib, symlink_dir} ;
32
31
use crate :: { Compiler , DependencyType , GitRepo , Mode } ;
33
32
@@ -70,7 +69,7 @@ impl Step for Std {
70
69
}
71
70
72
71
// If this is stage 0 or 1 and we're using a cached rustc, copy the stage 0 standard library instead of rebuilding.
73
- if std :: env :: var ( "BOOTSTRAP_CACHE_STAGE1" ) . is_ok ( ) && compiler. stage < 2 {
72
+ if builder . config . download_stage1 && compiler. stage < 2 {
74
73
return ;
75
74
}
76
75
@@ -507,7 +506,7 @@ impl Step for Rustc {
507
506
// No need to build from source if we've already downloaded rustc for this platform.
508
507
// This just copies the files from stage0 to stage1.
509
508
let compiler_to_use = builder. compiler_for ( compiler. stage , compiler. host , target) ;
510
- if use_cached_rustc ( & compiler) {
509
+ if builder . use_cached_rustc ( & compiler) {
511
510
return ;
512
511
} else if compiler_to_use != compiler {
513
512
builder. ensure ( Rustc { compiler : compiler_to_use, target } ) ;
@@ -907,14 +906,14 @@ impl Step for Sysroot {
907
906
908
907
// stage0-sysroot stores master libstd for the beta compiler.
909
908
// When not using the beta compiler, there's no need to override the sysroot.
910
- let sysroot = if compiler. stage == 0 && !use_cached_rustc ( & compiler) {
909
+ let sysroot = if compiler. stage == 0 && !builder . use_cached_rustc ( & compiler) {
911
910
builder. out . join ( & compiler. host . triple ) . join ( "stage0-sysroot" )
912
911
} else {
913
912
builder. out . join ( & compiler. host . triple ) . join ( format ! ( "stage{}" , compiler. stage) )
914
913
} ;
915
914
916
915
// The sysroot is copied to stage1/ in Assemble, not here.
917
- if use_cached_rustc ( & compiler) {
916
+ if builder . use_cached_rustc ( & compiler) {
918
917
return INTERNER . intern_path ( sysroot) ;
919
918
}
920
919
@@ -1086,7 +1085,7 @@ impl Step for Assemble {
1086
1085
t ! ( fs:: create_dir_all( & bindir) ) ;
1087
1086
let compiler = builder. rustc ( target_compiler) ;
1088
1087
1089
- if use_cached_rustc ( & build_compiler) {
1088
+ if builder . use_cached_rustc ( & build_compiler) {
1090
1089
let stage0 = builder. out . join ( & * build_compiler. host . triple ) . join ( "stage0" ) ;
1091
1090
builder. cp_r ( & stage0, & builder. sysroot ( target_compiler) ) ;
1092
1091
} else {
0 commit comments