Use more consistent progress messages in bootstrap
Before:
```
Testing ["rustc_interface"] stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
```
After:
```
Testing {rustc_interface} stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
```
Note there is a slight consistency between `build` and `test`: The
former doesn't print "compiler artifacts". It would be annoying to fix
and doesn't hurt anything, so I left it be.
```
; x t rustc_interface --stage 0 --dry-run
Testing {rustc_interface} stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
; x b rustc_interface --stage 0 --dry-run
Building {rustc_interface} stage0 compiler artifacts (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu)
```
This commit is contained in:
parent
cbede85538
commit
c8c849ef5c
6 changed files with 40 additions and 24 deletions
|
|
@ -97,13 +97,13 @@ impl RunConfig<'_> {
|
|||
self.builder.build.build
|
||||
}
|
||||
|
||||
/// Return a `-p=x -p=y` string suitable for passing to a cargo invocation.
|
||||
/// Return a list of crate names selected by `run.paths`.
|
||||
pub fn cargo_crates_in_set(&self) -> Interned<Vec<String>> {
|
||||
let mut crates = Vec::new();
|
||||
for krate in &self.paths {
|
||||
let path = krate.assert_single_path();
|
||||
let crate_name = self.builder.crate_paths[&path.path];
|
||||
crates.push(format!("-p={crate_name}"));
|
||||
crates.push(crate_name.to_string());
|
||||
}
|
||||
INTERNER.intern_list(crates)
|
||||
}
|
||||
|
|
@ -112,18 +112,17 @@ impl RunConfig<'_> {
|
|||
/// A description of the crates in this set, suitable for passing to `builder.info`.
|
||||
///
|
||||
/// `crates` should be generated by [`RunConfig::cargo_crates_in_set`].
|
||||
pub fn crate_description(crates: Interned<Vec<String>>) -> String {
|
||||
pub fn crate_description(crates: &[impl AsRef<str>]) -> String {
|
||||
if crates.is_empty() {
|
||||
return "".into();
|
||||
}
|
||||
|
||||
let mut descr = String::from(": {");
|
||||
for krate in &*crates {
|
||||
write!(descr, "{}, ", krate.strip_prefix("-p=").unwrap()).unwrap();
|
||||
let mut descr = String::from(" {");
|
||||
descr.push_str(crates[0].as_ref());
|
||||
for krate in &crates[1..] {
|
||||
descr.push_str(", ");
|
||||
descr.push_str(krate.as_ref());
|
||||
}
|
||||
|
||||
descr.pop();
|
||||
descr.pop();
|
||||
descr.push('}');
|
||||
descr
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ impl Step for Std {
|
|||
std_cargo(builder, target, compiler.stage, &mut cargo);
|
||||
|
||||
builder.info(&format!(
|
||||
"Checking stage{} std artifacts ({} -> {})",
|
||||
"Checking stage{} library artifacts ({} -> {})",
|
||||
builder.top_stage, &compiler.host, target
|
||||
));
|
||||
run_cargo(
|
||||
|
|
@ -157,7 +157,7 @@ impl Step for Std {
|
|||
}
|
||||
|
||||
builder.info(&format!(
|
||||
"Checking stage{} std test/bench/example targets ({} -> {})",
|
||||
"Checking stage{} library test/bench/example targets ({} -> {})",
|
||||
builder.top_stage, &compiler.host, target
|
||||
));
|
||||
run_cargo(
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@ macro_rules! clean_crate_tree {
|
|||
}
|
||||
|
||||
builder.info(&format!(
|
||||
"Cleaning stage{} {} artifacts ({} -> {}){}",
|
||||
compiler.stage, stringify!($name).to_lowercase(), &compiler.host, target, crate_description(self.crates),
|
||||
"Cleaning{} stage{} {} artifacts ({} -> {})",
|
||||
crate_description(&self.crates), compiler.stage, stringify!($name).to_lowercase(), &compiler.host, target,
|
||||
));
|
||||
|
||||
// NOTE: doesn't use `run_cargo` because we don't want to save a stamp file,
|
||||
|
|
|
|||
|
|
@ -111,7 +111,10 @@ impl Step for Std {
|
|||
let compiler_to_use = builder.compiler_for(compiler.stage, compiler.host, target);
|
||||
if compiler_to_use != compiler {
|
||||
builder.ensure(Std::new(compiler_to_use, target));
|
||||
builder.info(&format!("Uplifting stage1 std ({} -> {})", compiler_to_use.host, target));
|
||||
builder.info(&format!(
|
||||
"Uplifting stage1 library ({} -> {})",
|
||||
compiler_to_use.host, target
|
||||
));
|
||||
|
||||
// Even if we're not building std this stage, the new sysroot must
|
||||
// still contain the third party objects needed by various targets.
|
||||
|
|
@ -127,18 +130,21 @@ impl Step for Std {
|
|||
|
||||
let mut cargo = builder.cargo(compiler, Mode::Std, SourceType::InTree, target, "build");
|
||||
std_cargo(builder, target, compiler.stage, &mut cargo);
|
||||
for krate in &*self.crates {
|
||||
cargo.arg("-p").arg(krate);
|
||||
}
|
||||
|
||||
builder.info(&format!(
|
||||
"Building stage{} std artifacts ({} -> {}){}",
|
||||
"Building{} stage{} library artifacts ({} -> {})",
|
||||
crate_description(&self.crates),
|
||||
compiler.stage,
|
||||
&compiler.host,
|
||||
target,
|
||||
crate_description(self.crates),
|
||||
));
|
||||
run_cargo(
|
||||
builder,
|
||||
cargo,
|
||||
self.crates.to_vec(),
|
||||
vec![],
|
||||
&libstd_stamp(builder, compiler, target),
|
||||
target_deps,
|
||||
false,
|
||||
|
|
@ -429,7 +435,7 @@ impl Step for StdLink {
|
|||
let target_compiler = self.target_compiler;
|
||||
let target = self.target;
|
||||
builder.info(&format!(
|
||||
"Copying stage{} std from stage{} ({} -> {} / {})",
|
||||
"Copying stage{} library from stage{} ({} -> {} / {})",
|
||||
target_compiler.stage, compiler.stage, &compiler.host, target_compiler.host, target
|
||||
));
|
||||
let libdir = builder.sysroot_libdir(target_compiler, target);
|
||||
|
|
@ -718,17 +724,21 @@ impl Step for Rustc {
|
|||
}
|
||||
}
|
||||
|
||||
for krate in &*self.crates {
|
||||
cargo.arg("-p").arg(krate);
|
||||
}
|
||||
|
||||
builder.info(&format!(
|
||||
"Building stage{} compiler artifacts ({} -> {}){}",
|
||||
"Building{} stage{} compiler artifacts ({} -> {})",
|
||||
crate_description(&self.crates),
|
||||
compiler.stage,
|
||||
&compiler.host,
|
||||
target,
|
||||
crate_description(self.crates),
|
||||
));
|
||||
run_cargo(
|
||||
builder,
|
||||
cargo,
|
||||
self.crates.to_vec(),
|
||||
vec![],
|
||||
&librustc_stamp(builder, compiler, target),
|
||||
vec![],
|
||||
false,
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ use std::fs;
|
|||
use std::io;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
use crate::builder::crate_description;
|
||||
use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
|
||||
use crate::cache::{Interned, INTERNER};
|
||||
use crate::compile;
|
||||
|
|
@ -554,7 +555,8 @@ fn doc_std(
|
|||
requested_crates: &[String],
|
||||
) {
|
||||
builder.info(&format!(
|
||||
"Documenting stage{} std ({}) in {} format",
|
||||
"Documenting{} stage{} library ({}) in {} format",
|
||||
crate_description(requested_crates),
|
||||
stage,
|
||||
target,
|
||||
format.as_str()
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ use std::iter;
|
|||
use std::path::{Path, PathBuf};
|
||||
use std::process::{Command, Stdio};
|
||||
|
||||
use crate::builder::crate_description;
|
||||
use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
|
||||
use crate::cache::Interned;
|
||||
use crate::compile;
|
||||
|
|
@ -2154,8 +2155,12 @@ impl Step for Crate {
|
|||
}
|
||||
|
||||
builder.info(&format!(
|
||||
"{} {:?} stage{} ({} -> {})",
|
||||
test_kind, self.crates, compiler.stage, &compiler.host, target
|
||||
"{}{} stage{} ({} -> {})",
|
||||
test_kind,
|
||||
crate_description(&self.crates),
|
||||
compiler.stage,
|
||||
&compiler.host,
|
||||
target
|
||||
));
|
||||
let _time = util::timeit(&builder);
|
||||
try_run(builder, &mut cargo.into());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue