Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustbuild: check for final stage properly and so on #38752

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,14 @@ impl Config {
pub fn very_verbose(&self) -> bool {
self.verbose > 1
}

pub fn final_stage(&self) -> u32 {
if self.full_bootstrap {
2
} else {
1
}
}
}

#[cfg(not(windows))]
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ pub fn analysis(build: &Build, compiler: &Compiler, target: &str) {
println!("\tskipping - not a build host");
return
}
if compiler.stage != 2 {
println!("\tskipping - not stage2");
if !compiler.is_final_stage(build) {
println!("\tskipping - not final stage");
return
}

Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -910,6 +910,10 @@ impl Build {
compiler.stage >= 2 &&
self.config.host.iter().any(|h| h == target)
}

fn final_stage(&self) -> u32 {
self.config.final_stage()
}
}

impl<'a> Compiler<'a> {
Expand Down
14 changes: 7 additions & 7 deletions src/bootstrap/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
.default(build.config.docs)
.run(move |s| doc::rustbook(build, s.target, "nomicon"));
rules.doc("doc-standalone", "src/doc")
.dep(move |s| s.name("rustc").host(&build.config.build).target(&build.config.build))
.dep(move |s| s.name("rustc").host(&build.config.build).target(&build.config.build).stage(build.final_stage()))
.default(build.config.docs)
.run(move |s| doc::standalone(build, s.stage, s.target));
rules.doc("doc-error-index", "src/tools/error_index_generator")
Expand Down Expand Up @@ -548,7 +548,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
// ========================================================================
// Distribution targets
rules.dist("dist-rustc", "src/librustc")
.dep(move |s| s.name("rustc").host(&build.config.build))
.dep(move |s| s.name("rustc").host(&build.config.build).stage(build.final_stage()))
.host(true)
.default(true)
.run(move |s| dist::rustc(build, s.stage, s.target));
Expand All @@ -561,7 +561,7 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
s.name("librustc-link")
} else {
s.name("libtest-link")
}
}.stage(build.final_stage())
})
.default(true)
.run(move |s| dist::std(build, &s.compiler(), s.target));
Expand All @@ -578,14 +578,14 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
.run(move |s| dist::rust_src(build, s.target));
rules.dist("dist-docs", "src/doc")
.default(true)
.dep(|s| s.name("default:doc"))
.dep(move |s| s.name("default:doc").stage(build.final_stage()))
.run(move |s| dist::docs(build, s.stage, s.target));
rules.dist("dist-analysis", "analysis")
.dep(|s| s.name("dist-std"))
.dep(move |s| s.name("dist-std").stage(build.final_stage()))
.default(true)
.run(move |s| dist::analysis(build, &s.compiler(), s.target));
rules.dist("install", "src")
.dep(|s| s.name("default:dist"))
.dep(move |s| s.name("default:dist").stage(build.final_stage()))
.run(move |s| install::install(build, s.stage, s.target));

rules.verify();
Expand Down Expand Up @@ -750,7 +750,7 @@ impl<'a> Rules<'a> {
Rules {
build: build,
sbuild: Step {
stage: build.flags.stage.unwrap_or(2),
stage: build.flags.stage.unwrap_or(build.config.final_stage()),
target: &build.config.build,
host: &build.config.build,
name: "",
Expand Down