File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -38,13 +38,19 @@ fn main() {
38
38
// is passed (a bit janky...)
39
39
let target = args. windows ( 2 ) . find ( |w| & * w[ 0 ] == "--target" )
40
40
. and_then ( |w| w[ 1 ] . to_str ( ) ) ;
41
+ let version = args. iter ( ) . find ( |w| & * * w == "-vV" ) ;
41
42
42
43
// Build scripts always use the snapshot compiler which is guaranteed to be
43
44
// able to produce an executable, whereas intermediate compilers may not
44
45
// have the standard library built yet and may not be able to produce an
45
46
// executable. Otherwise we just use the standard compiler we're
46
47
// bootstrapping with.
47
- let ( rustc, libdir) = if target. is_none ( ) {
48
+ //
49
+ // Also note that cargo will detect the version of the compiler to trigger
50
+ // a rebuild when the compiler changes. If this happens, we want to make
51
+ // sure to use the actual compiler instead of the snapshot compiler becase
52
+ // that's the one that's actually changing.
53
+ let ( rustc, libdir) = if target. is_none ( ) && version. is_none ( ) {
48
54
( "RUSTC_SNAPSHOT" , "RUSTC_SNAPSHOT_LIBDIR" )
49
55
} else {
50
56
( "RUSTC_REAL" , "RUSTC_LIBDIR" )
You can’t perform that action at this time.
0 commit comments