Skip to content

Commit 74b3684

Browse files
committed
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.
2 parents a7b5d69 + 8efbfae commit 74b3684

File tree

5 files changed

+51
-8
lines changed

5 files changed

+51
-8
lines changed

src/bootstrap/Cargo.lock

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ winapi = "0.2"
3131
kernel32-sys = "0.2"
3232
gcc = "0.3.17"
3333
libc = "0.2"
34+
md5 = "0.1"

src/bootstrap/build/channel.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
use std::env;
1112
use std::fs::{self, File};
1213
use std::io::prelude::*;
13-
use std::path::Path;
1414
use std::process::Command;
1515

1616
use build_helper::output;
17+
use md5;
1718

1819
use build::Build;
19-
use build::util::mtime;
2020

2121
pub fn collect(build: &mut Build) {
2222
let mut main_mk = String::new();
@@ -80,7 +80,8 @@ pub fn collect(build: &mut Build) {
8080
build.short_ver_hash = Some(short_ver_hash);
8181
}
8282

83-
build.bootstrap_key = mtime(Path::new("config.toml")).seconds()
84-
.to_string();
83+
let key = md5::compute(build.release.as_bytes());
84+
build.bootstrap_key = format!("{:02x}{:02x}{:02x}{:02x}",
85+
key[0], key[1], key[2], key[3]);
86+
env::set_var("RUSTC_BOOTSTRAP_KEY", &build.bootstrap_key);
8587
}
86-

src/bootstrap/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ extern crate libc;
2020
extern crate num_cpus;
2121
extern crate rustc_serialize;
2222
extern crate toml;
23+
extern crate md5;
2324

2425
use std::env;
2526

src/rustc/Cargo.lock

+37-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)