diff options
| author | Jonathan Turner <jturner@mozilla.com> | 2016-08-18 15:22:23 -0700 |
|---|---|---|
| committer | Jonathan Turner <jturner@mozilla.com> | 2016-08-18 15:22:23 -0700 |
| commit | ffbb8600fbba009598cbebf7149d0bd7a736b928 (patch) | |
| tree | 47cb804ed5c68941aff9863fa727fca783c992dd /src/bootstrap | |
| parent | 43c090ed69a624928c03ad61a29a59badf80ff7b (diff) | |
| download | rust-ffbb8600fbba009598cbebf7149d0bd7a736b928.tar.gz rust-ffbb8600fbba009598cbebf7149d0bd7a736b928.zip | |
Add workaround to detect correct compiler version
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/bin/rustc.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs index c64cbb9a74e..175e32125f2 100644 --- a/src/bootstrap/bin/rustc.rs +++ b/src/bootstrap/bin/rustc.rs @@ -38,13 +38,19 @@ fn main() { // is passed (a bit janky...) let target = args.windows(2).find(|w| &*w[0] == "--target") .and_then(|w| w[1].to_str()); + let version = args.iter().find(|w| &**w == "-vV"); // Build scripts always use the snapshot compiler which is guaranteed to be // able to produce an executable, whereas intermediate compilers may not // have the standard library built yet and may not be able to produce an // executable. Otherwise we just use the standard compiler we're // bootstrapping with. - let (rustc, libdir) = if target.is_none() { + // + // Also note that cargo will detect the version of the compiler to trigger + // a rebuild when the compiler changes. If this happens, we want to make + // sure to use the actual compiler instead of the snapshot compiler becase + // that's the one that's actually changing. + let (rustc, libdir) = if target.is_none() && version.is_none() { ("RUSTC_SNAPSHOT", "RUSTC_SNAPSHOT_LIBDIR") } else { ("RUSTC_REAL", "RUSTC_LIBDIR") |
