diff options
| author | Mark Simulacrum <mark.simulacrum@gmail.com> | 2018-03-09 19:19:59 -0700 |
|---|---|---|
| committer | Mark Simulacrum <mark.simulacrum@gmail.com> | 2018-04-03 11:39:16 -0600 |
| commit | e7342b8f4233b67093c62c4044273185312aac59 (patch) | |
| tree | be99ae0fef31cce8e82009f1e13fdb9e0e5a5760 /src/bootstrap | |
| parent | a5e56b62c5bef0b171785d5b20b3fd4e714db528 (diff) | |
| download | rust-e7342b8f4233b67093c62c4044273185312aac59.tar.gz rust-e7342b8f4233b67093c62c4044273185312aac59.zip | |
Permit constructing Build without executing
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/lib.rs | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index cbe19aeb633..cad4a794cf0 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -326,7 +326,7 @@ impl Build { let rls_info = channel::GitInfo::new(&config, &src.join("src/tools/rls")); let rustfmt_info = channel::GitInfo::new(&config, &src.join("src/tools/rustfmt")); - Build { + let mut build = Build { initial_rustc: config.initial_rustc.clone(), initial_cargo: config.initial_cargo.clone(), local_rebuild: config.local_rebuild, @@ -357,7 +357,27 @@ impl Build { delayed_failures: RefCell::new(Vec::new()), prerelease_version: Cell::new(None), tool_artifacts: Default::default(), + }; + + build.verbose("finding compilers"); + cc_detect::find(&mut build); + build.verbose("running sanity check"); + sanity::check(&mut build); + // If local-rust is the same major.minor as the current version, then force a local-rebuild + let local_version_verbose = output( + Command::new(&build.initial_rustc).arg("--version").arg("--verbose")); + let local_release = local_version_verbose + .lines().filter(|x| x.starts_with("release:")) + .next().unwrap().trim_left_matches("release:").trim(); + let my_version = channel::CFG_RELEASE_NUM; + if local_release.split('.').take(2).eq(my_version.split('.').take(2)) { + build.verbose(&format!("auto-detected local-rebuild {}", local_release)); + build.local_rebuild = true; } + build.verbose("learning about cargo"); + metadata::build(&mut build); + + build } pub fn build_triple(&self) -> &[Interned<String>] { @@ -376,24 +396,6 @@ impl Build { return clean::clean(self, all); } - self.verbose("finding compilers"); - cc_detect::find(self); - self.verbose("running sanity check"); - sanity::check(self); - // If local-rust is the same major.minor as the current version, then force a local-rebuild - let local_version_verbose = output( - Command::new(&self.initial_rustc).arg("--version").arg("--verbose")); - let local_release = local_version_verbose - .lines().filter(|x| x.starts_with("release:")) - .next().unwrap().trim_left_matches("release:").trim(); - let my_version = channel::CFG_RELEASE_NUM; - if local_release.split('.').take(2).eq(my_version.split('.').take(2)) { - self.verbose(&format!("auto-detected local-rebuild {}", local_release)); - self.local_rebuild = true; - } - self.verbose("learning about cargo"); - metadata::build(self); - let builder = builder::Builder::new(&self); if let Some(path) = builder.paths.get(0) { if path == Path::new("nonexistent/path/to/trigger/cargo/metadata") { |
