bootstrap: Remove need for RUSTC_SAVE_ANALYSIS
This commit is contained in:
parent
d63e2def82
commit
04cb0653a8
2 changed files with 20 additions and 26 deletions
|
@ -184,15 +184,6 @@ fn main() {
|
||||||
cmd.arg("-C").arg(format!("codegen-units={}", s));
|
cmd.arg("-C").arg(format!("codegen-units={}", s));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emit save-analysis info.
|
|
||||||
if env::var("RUSTC_SAVE_ANALYSIS") == Ok("api".to_string()) {
|
|
||||||
cmd.arg("-Zsave-analysis");
|
|
||||||
cmd.env("RUST_SAVE_ANALYSIS_CONFIG",
|
|
||||||
"{\"output_file\": null,\"full_docs\": false,\
|
|
||||||
\"pub_only\": true,\"reachable_only\": false,\
|
|
||||||
\"distro_crate\": true,\"signatures\": false,\"borrow_data\": false}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dealing with rpath here is a little special, so let's go into some
|
// Dealing with rpath here is a little special, so let's go into some
|
||||||
// detail. First off, `-rpath` is a linker option on Unix platforms
|
// detail. First off, `-rpath` is a linker option on Unix platforms
|
||||||
// which adds to the runtime dynamic loader path when looking for
|
// which adds to the runtime dynamic loader path when looking for
|
||||||
|
|
|
@ -796,6 +796,21 @@ impl<'a> Builder<'a> {
|
||||||
cargo.env("RUST_CHECK", "1");
|
cargo.env("RUST_CHECK", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let stage;
|
||||||
|
if compiler.stage == 0 && self.local_rebuild {
|
||||||
|
// Assume the local-rebuild rustc already has stage1 features.
|
||||||
|
stage = 1;
|
||||||
|
} else {
|
||||||
|
stage = compiler.stage;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut rustflags = Rustflags::new();
|
||||||
|
if stage != 0 {
|
||||||
|
rustflags.env("RUSTFLAGS_NOT_BOOTSTRAP");
|
||||||
|
} else {
|
||||||
|
rustflags.env("RUSTFLAGS_BOOTSTRAP");
|
||||||
|
}
|
||||||
|
|
||||||
match mode {
|
match mode {
|
||||||
Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {},
|
Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {},
|
||||||
Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {
|
Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {
|
||||||
|
@ -852,22 +867,6 @@ impl<'a> Builder<'a> {
|
||||||
}
|
}
|
||||||
cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata);
|
cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata);
|
||||||
|
|
||||||
let stage;
|
|
||||||
if compiler.stage == 0 && self.local_rebuild {
|
|
||||||
// Assume the local-rebuild rustc already has stage1 features.
|
|
||||||
stage = 1;
|
|
||||||
} else {
|
|
||||||
stage = compiler.stage;
|
|
||||||
}
|
|
||||||
|
|
||||||
let mut rustflags = Rustflags::new();
|
|
||||||
rustflags.env(&format!("RUSTFLAGS_STAGE_{}", stage));
|
|
||||||
if stage != 0 {
|
|
||||||
rustflags.env("RUSTFLAGS_NOT_BOOTSTRAP");
|
|
||||||
} else {
|
|
||||||
rustflags.env("RUSTFLAGS_BOOTSTRAP");
|
|
||||||
}
|
|
||||||
|
|
||||||
if cmd == "clippy" {
|
if cmd == "clippy" {
|
||||||
rustflags.arg("-Zforce-unstable-if-unmarked");
|
rustflags.arg("-Zforce-unstable-if-unmarked");
|
||||||
}
|
}
|
||||||
|
@ -1064,7 +1063,11 @@ impl<'a> Builder<'a> {
|
||||||
&& self.config.extended
|
&& self.config.extended
|
||||||
&& compiler.is_final_stage(self)
|
&& compiler.is_final_stage(self)
|
||||||
{
|
{
|
||||||
cargo.env("RUSTC_SAVE_ANALYSIS", "api".to_string());
|
rustflags.arg("-Zsave-analysis");
|
||||||
|
cargo.env("RUST_SAVE_ANALYSIS_CONFIG",
|
||||||
|
"{\"output_file\": null,\"full_docs\": false,\
|
||||||
|
\"pub_only\": true,\"reachable_only\": false,\
|
||||||
|
\"distro_crate\": true,\"signatures\": false,\"borrow_data\": false}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs
|
// For `cargo doc` invocations, make rustdoc print the Rust version into the docs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue