about summary refs log tree commit diff
path: root/src/bootstrap/build
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2016-04-11 17:09:55 -0700
committerAlex Crichton <alex@alexcrichton.com>2016-04-11 17:16:32 -0700
commit8efbfae6bf3ec3995dca0604d09c839967840b7a (patch)
treeefe95e7880f36805d298b8355252f8dfd8c75a55 /src/bootstrap/build
parentb622c3e0856767d8e53cf141e2e0a7b6d72a198b (diff)
downloadrust-8efbfae6bf3ec3995dca0604d09c839967840b7a.tar.gz
rust-8efbfae6bf3ec3995dca0604d09c839967840b7a.zip
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/build')
-rw-r--r--src/bootstrap/build/channel.rs11
1 files changed, 6 insertions, 5 deletions
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);
 }
-