diff options
| author | bors <bors@rust-lang.org> | 2016-04-15 04:10:11 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-04-15 04:10:11 -0700 |
| commit | 74b3684d009c0e243a282c9a573ef5e29a2681d9 (patch) | |
| tree | 4c52a6503a3b7d4b229a1ed841c2d1d9e3bba2ff /src/bootstrap | |
| parent | a7b5d69ba5b2623ab7ef440e90914146a537e6a7 (diff) | |
| parent | 8efbfae6bf3ec3995dca0604d09c839967840b7a (diff) | |
| download | rust-74b3684d009c0e243a282c9a573ef5e29a2681d9.tar.gz rust-74b3684d009c0e243a282c9a573ef5e29a2681d9.zip | |
Auto merge of #32895 - alexcrichton:rustbuild-beta, r=brson
rustbuild: Fix handling of the bootstrap key Bring the calculation logic in line with the makefiles and also set the RUSTC_BOOTSTRAP_KEY environment variable to enable the bootstrap on the stable compiler.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/Cargo.lock | 6 | ||||
| -rw-r--r-- | src/bootstrap/Cargo.toml | 1 | ||||
| -rw-r--r-- | src/bootstrap/build/channel.rs | 11 | ||||
| -rw-r--r-- | src/bootstrap/main.rs | 1 |
4 files changed, 14 insertions, 5 deletions
diff --git a/src/bootstrap/Cargo.lock b/src/bootstrap/Cargo.lock index 9bb3e79744b..39c7a375011 100644 --- a/src/bootstrap/Cargo.lock +++ b/src/bootstrap/Cargo.lock @@ -9,6 +9,7 @@ dependencies = [ "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)", + "md5 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", @@ -60,6 +61,11 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "md5" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "num_cpus" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index 7b379e1c7b6..f9a64567ffd 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -31,3 +31,4 @@ winapi = "0.2" kernel32-sys = "0.2" gcc = "0.3.17" libc = "0.2" +md5 = "0.1" diff --git a/src/bootstrap/build/channel.rs b/src/bootstrap/build/channel.rs index 5c39356d214..611e3475610 100644 --- a/src/bootstrap/build/channel.rs +++ b/src/bootstrap/build/channel.rs @@ -8,15 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +use std::env; use std::fs::{self, File}; use std::io::prelude::*; -use std::path::Path; use std::process::Command; use build_helper::output; +use md5; use build::Build; -use build::util::mtime; pub fn collect(build: &mut Build) { let mut main_mk = String::new(); @@ -80,7 +80,8 @@ pub fn collect(build: &mut Build) { build.short_ver_hash = Some(short_ver_hash); } - build.bootstrap_key = mtime(Path::new("config.toml")).seconds() - .to_string(); + let key = md5::compute(build.release.as_bytes()); + build.bootstrap_key = format!("{:02x}{:02x}{:02x}{:02x}", + key[0], key[1], key[2], key[3]); + env::set_var("RUSTC_BOOTSTRAP_KEY", &build.bootstrap_key); } - diff --git a/src/bootstrap/main.rs b/src/bootstrap/main.rs index 32432132c17..bf29ac107ff 100644 --- a/src/bootstrap/main.rs +++ b/src/bootstrap/main.rs @@ -20,6 +20,7 @@ extern crate libc; extern crate num_cpus; extern crate rustc_serialize; extern crate toml; +extern crate md5; use std::env; |
