Skip to content

Commit ecff71a

Browse files
committed
Auto merge of #37800 - alexcrichton:new-bootstrap, r=eddyb
Update the bootstrap compiler Now that we've got a beta build, let's use it!
2 parents 5a02480 + 2186660 commit ecff71a

File tree

52 files changed

+30
-559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+30
-559
lines changed

mk/crates.mk

+2-6
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ HOST_CRATES := syntax syntax_ext proc_macro_tokens proc_macro_plugin syntax_pos
6565
TOOLS := compiletest rustdoc rustc rustbook error_index_generator
6666

6767
DEPS_core :=
68-
DEPS_compiler_builtins := core
68+
DEPS_compiler_builtins := core native:compiler-rt
6969
DEPS_alloc := core libc alloc_system
7070
DEPS_alloc_system := core libc
7171
DEPS_alloc_jemalloc := core libc native:jemalloc
@@ -79,11 +79,7 @@ DEPS_panic_unwind := libc alloc unwind
7979
DEPS_unwind := libc
8080

8181
RUSTFLAGS_compiler_builtins := -lstatic=compiler-rt
82-
83-
# FIXME(stage0): change this to just `RUSTFLAGS_panic_abort := ...`
84-
RUSTFLAGS1_panic_abort := -C panic=abort
85-
RUSTFLAGS2_panic_abort := -C panic=abort
86-
RUSTFLAGS3_panic_abort := -C panic=abort
82+
RUSTFLAGS_panic_abort := -C panic=abort
8783

8884
DEPS_std := core libc rand alloc collections compiler_builtins rustc_unicode \
8985
native:backtrace \

mk/main.mk

+2-8
Original file line numberDiff line numberDiff line change
@@ -372,15 +372,12 @@ CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATUR
372372
# Turn on feature-staging
373373
export CFG_DISABLE_UNSTABLE_FEATURES
374374
# Subvert unstable feature lints to do the self-build
375-
export RUSTC_BOOTSTRAP=1
376375
endif
377376
ifdef CFG_MUSL_ROOT
378377
export CFG_MUSL_ROOT
379378
endif
380379

381-
# FIXME: Transitionary measure to bootstrap using the old bootstrap logic.
382-
# Remove this once the bootstrap compiler uses the new login in Issue #36548.
383-
export RUSTC_BOOTSTRAP_KEY=62b3e239
380+
export RUSTC_BOOTSTRAP := 1
384381

385382
######################################################################
386383
# Per-stage targets and runner
@@ -443,10 +440,7 @@ endif
443440
TSREQ$(1)_T_$(2)_H_$(3) = \
444441
$$(HSREQ$(1)_H_$(3)) \
445442
$$(foreach obj,$$(REQUIRED_OBJECTS_$(2)),\
446-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj)) \
447-
$$(TLIB0_T_$(2)_H_$(3))/$$(call CFG_STATIC_LIB_NAME_$(2),compiler-rt)
448-
# ^ This copies `libcompiler-rt.a` to the stage0 sysroot
449-
# ^ TODO(stage0) update this to not copy `libcompiler-rt.a` to stage0
443+
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj))
450444

451445
# Prerequisites for a working stageN compiler and libraries, for a specific
452446
# target

src/Cargo.lock

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

src/Cargo.toml

+17
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,20 @@ members = [
1111
"tools/rustbook",
1212
"tools/tidy",
1313
]
14+
15+
# Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit
16+
# MSVC when running the compile-fail test suite when a should-fail test panics.
17+
# But hey if this is removed and it gets past the bots, sounds good to me.
18+
[profile.release]
19+
opt-level = 2
20+
[profile.bench]
21+
opt-level = 2
22+
23+
# These options are controlled from our rustc wrapper script, so turn them off
24+
# here and have them controlled elsewhere.
25+
[profile.dev]
26+
debug = false
27+
debug-assertions = false
28+
[profile.test]
29+
debug = false
30+
debug-assertions = false

src/bootstrap/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ getopts = "0.2"
2929
rustc-serialize = "0.3"
3030
gcc = "0.3.38"
3131
libc = "0.2"
32-
md5 = "0.1"

src/bootstrap/channel.rs

-17
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use std::io::prelude::*;
2020
use std::process::Command;
2121

2222
use build_helper::output;
23-
use md5;
2423

2524
use Build;
2625

@@ -91,20 +90,4 @@ pub fn collect(build: &mut Build) {
9190
build.ver_hash = Some(ver_hash);
9291
build.short_ver_hash = Some(short_ver_hash);
9392
}
94-
95-
// Calculate this compiler's bootstrap key, which is currently defined as
96-
// the first 8 characters of the md5 of the release string.
97-
let key = md5::compute(build.release.as_bytes());
98-
build.bootstrap_key = format!("{:02x}{:02x}{:02x}{:02x}",
99-
key[0], key[1], key[2], key[3]);
100-
101-
// Slurp up the stage0 bootstrap key as we're bootstrapping from an
102-
// otherwise stable compiler.
103-
let mut s = String::new();
104-
t!(t!(File::open(build.src.join("src/stage0.txt"))).read_to_string(&mut s));
105-
if let Some(line) = s.lines().find(|l| l.starts_with("rustc_key")) {
106-
if let Some(key) = line.split(": ").nth(1) {
107-
build.bootstrap_key_stage0 = key.to_string();
108-
}
109-
}
11093
}

src/bootstrap/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub fn compiletest(build: &Build,
220220
}
221221
}
222222
}
223-
build.add_bootstrap_key(&mut cmd);
223+
cmd.env("RUSTC_BOOTSTRAP", "1");
224224

225225
cmd.arg("--adb-path").arg("adb");
226226
cmd.arg("--adb-test-dir").arg(ADB_TEST_DIR);

src/bootstrap/compile.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ fn build_startup_objects(build: &Build, target: &str, into: &Path) {
120120
for file in t!(fs::read_dir(build.src.join("src/rtstartup"))) {
121121
let file = t!(file);
122122
let mut cmd = Command::new(&compiler_path);
123-
build.add_bootstrap_key(&mut cmd);
124-
build.run(cmd.arg("--target").arg(target)
123+
build.run(cmd.env("RUSTC_BOOTSTRAP", "1")
124+
.arg("--target").arg(target)
125125
.arg("--emit=obj")
126126
.arg("--out-dir").arg(into)
127127
.arg(file.path()));

src/bootstrap/lib.rs

+2-14
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ extern crate cmake;
2222
extern crate filetime;
2323
extern crate gcc;
2424
extern crate getopts;
25-
extern crate md5;
2625
extern crate num_cpus;
2726
extern crate rustc_serialize;
2827
extern crate toml;
@@ -120,8 +119,6 @@ pub struct Build {
120119
version: String,
121120
package_vers: String,
122121
local_rebuild: bool,
123-
bootstrap_key: String,
124-
bootstrap_key_stage0: String,
125122

126123
// Probed tools at runtime
127124
lldb_version: Option<String>,
@@ -205,8 +202,6 @@ impl Build {
205202
ver_date: None,
206203
version: String::new(),
207204
local_rebuild: local_rebuild,
208-
bootstrap_key: String::new(),
209-
bootstrap_key_stage0: String::new(),
210205
package_vers: String::new(),
211206
cc: HashMap::new(),
212207
cxx: HashMap::new(),
@@ -438,7 +433,8 @@ impl Build {
438433
.env("RUSTDOC_REAL", self.rustdoc(compiler))
439434
.env("RUSTC_FLAGS", self.rustc_flags(target).join(" "));
440435

441-
self.add_bootstrap_key(&mut cargo);
436+
// Enable usage of unstable features
437+
cargo.env("RUSTC_BOOTSTRAP", "1");
442438

443439
// Specify some various options for build scripts used throughout
444440
// the build.
@@ -655,14 +651,6 @@ impl Build {
655651
add_lib_path(vec![self.rustc_libdir(compiler)], cmd);
656652
}
657653

658-
/// Adds the compiler's bootstrap key to the environment of `cmd`.
659-
fn add_bootstrap_key(&self, cmd: &mut Command) {
660-
cmd.env("RUSTC_BOOTSTRAP", "1");
661-
// FIXME: Transitionary measure to bootstrap using the old bootstrap logic.
662-
// Remove this once the bootstrap compiler uses the new login in Issue #36548.
663-
cmd.env("RUSTC_BOOTSTRAP_KEY", "62b3e239");
664-
}
665-
666654
/// Returns the compiler's libdir where it stores the dynamic libraries that
667655
/// it itself links against.
668656
///

src/libcore/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@
8989
#![feature(specialization)]
9090
#![feature(staged_api)]
9191
#![feature(unboxed_closures)]
92-
#![cfg_attr(stage0, feature(question_mark))]
9392
#![feature(never_type)]
9493
#![feature(prelude_import)]
9594

src/libgraphviz/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@
295295
#![cfg_attr(not(stage0), deny(warnings))]
296296

297297
#![feature(str_escape)]
298-
#![cfg_attr(stage0, feature(question_mark))]
299298

300299
use self::LabelText::*;
301300

src/librustc/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#![feature(conservative_impl_trait)]
3232
#![feature(const_fn)]
3333
#![feature(core_intrinsics)]
34-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
3534
#![cfg_attr(stage0, feature(item_like_imports))]
3635
#![feature(libc)]
3736
#![feature(nonzero)]
@@ -41,7 +40,6 @@
4140
#![feature(slice_patterns)]
4241
#![feature(staged_api)]
4342
#![feature(unboxed_closures)]
44-
#![cfg_attr(stage0, feature(question_mark))]
4543
#![cfg_attr(test, feature(test))]
4644

4745
extern crate arena;

src/librustc_back/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
#![feature(rand)]
3737
#![feature(rustc_private)]
3838
#![feature(staged_api)]
39-
#![cfg_attr(stage0, feature(question_mark))]
4039
#![cfg_attr(test, feature(rand))]
4140

4241
extern crate syntax;

src/librustc_borrowck/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@
1919

2020
#![allow(non_camel_case_types)]
2121

22-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
2322
#![feature(quote)]
2423
#![feature(rustc_diagnostic_macros)]
2524
#![feature(rustc_private)]
2625
#![feature(staged_api)]
2726
#![feature(associated_consts)]
2827
#![feature(nonzero)]
29-
#![cfg_attr(stage0, feature(question_mark))]
3028
#[macro_use] extern crate log;
3129
#[macro_use] extern crate syntax;
3230
extern crate syntax_pos;

src/librustc_const_eval/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@
2222
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
2323
html_root_url = "https://doc.rust-lang.org/nightly/")]
2424

25-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
2625
#![feature(rustc_private)]
2726
#![feature(staged_api)]
2827
#![feature(rustc_diagnostic_macros)]
2928
#![feature(slice_patterns)]
30-
#![cfg_attr(stage0, feature(question_mark))]
3129
#![feature(box_patterns)]
3230
#![feature(box_syntax)]
3331

src/librustc_const_math/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#![feature(rustc_private)]
2727
#![feature(staged_api)]
28-
#![cfg_attr(stage0, feature(question_mark))]
2928

3029
#[macro_use] extern crate log;
3130
#[macro_use] extern crate syntax;

src/librustc_driver/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,12 @@
2424
#![cfg_attr(not(stage0), deny(warnings))]
2525

2626
#![feature(box_syntax)]
27-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
2827
#![feature(libc)]
2928
#![feature(quote)]
3029
#![feature(rustc_diagnostic_macros)]
3130
#![feature(rustc_private)]
3231
#![feature(set_stdio)]
3332
#![feature(staged_api)]
34-
#![cfg_attr(stage0, feature(question_mark))]
3533

3634
extern crate arena;
3735
extern crate flate;

src/librustc_errors/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#![allow(unused_attributes)]
2222
#![feature(rustc_private)]
2323
#![feature(staged_api)]
24-
#![cfg_attr(stage0, feature(question_mark))]
2524
#![feature(range_contains)]
2625
#![feature(libc)]
2726
#![feature(unicode)]

src/librustc_incremental/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
html_root_url = "https://doc.rust-lang.org/nightly/")]
2020
#![cfg_attr(not(stage0), deny(warnings))]
2121

22-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
23-
#![cfg_attr(stage0, feature(question_mark))]
2422
#![feature(rustc_private)]
2523
#![feature(staged_api)]
2624
#![feature(rand)]

src/librustc_lint/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#![cfg_attr(test, feature(test))]
3232
#![feature(box_patterns)]
3333
#![feature(box_syntax)]
34-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
3534
#![feature(quote)]
3635
#![feature(rustc_diagnostic_macros)]
3736
#![feature(rustc_private)]

src/librustc_llvm/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424

2525
#![feature(associated_consts)]
2626
#![feature(box_syntax)]
27+
#![feature(concat_idents)]
2728
#![feature(libc)]
2829
#![feature(link_args)]
29-
#![feature(staged_api)]
3030
#![feature(linked_from)]
31-
#![feature(concat_idents)]
31+
#![feature(staged_api)]
3232

3333
extern crate libc;
3434

src/librustc_metadata/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020
#![feature(box_patterns)]
2121
#![feature(conservative_impl_trait)]
2222
#![feature(core_intrinsics)]
23-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
2423
#![feature(proc_macro_internals)]
2524
#![feature(proc_macro_lib)]
26-
#![cfg_attr(stage0, feature(question_mark))]
2725
#![feature(quote)]
2826
#![feature(rustc_diagnostic_macros)]
2927
#![feature(rustc_private)]

src/librustc_mir/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,10 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2222

2323
#![feature(associated_consts)]
2424
#![feature(box_patterns)]
25-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
2625
#![cfg_attr(stage0, feature(item_like_imports))]
2726
#![feature(rustc_diagnostic_macros)]
2827
#![feature(rustc_private)]
2928
#![feature(staged_api)]
30-
#![cfg_attr(stage0, feature(question_mark))]
3129

3230
#[macro_use] extern crate log;
3331
extern crate graphviz as dot;

src/librustc_passes/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
html_root_url = "https://doc.rust-lang.org/nightly/")]
2424
#![cfg_attr(not(stage0), deny(warnings))]
2525

26-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
2726
#![feature(rustc_diagnostic_macros)]
2827
#![feature(staged_api)]
2928
#![feature(rustc_private)]

src/librustc_privacy/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
html_root_url = "https://doc.rust-lang.org/nightly/")]
1818
#![cfg_attr(not(stage0), deny(warnings))]
1919

20-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
2120
#![feature(rustc_diagnostic_macros)]
2221
#![feature(rustc_private)]
2322
#![feature(staged_api)]

src/librustc_resolve/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#![feature(associated_consts)]
2121
#![feature(borrow_state)]
22-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
2322
#![feature(rustc_diagnostic_macros)]
2423
#![feature(rustc_private)]
2524
#![feature(staged_api)]

src/librustc_save_analysis/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
#![cfg_attr(not(stage0), deny(warnings))]
1919

2020
#![feature(custom_attribute)]
21-
#![cfg_attr(stage0, feature(dotdot_in_tuple_patterns))]
2221
#![allow(unused_attributes)]
2322
#![feature(rustc_private)]
2423
#![feature(staged_api)]

0 commit comments

Comments
 (0)