Skip to content

bootstrap: Various Step refactors #111955

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

Merged
merged 8 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Extend msg and description to work with any subcommand
Previously `description` only supported `Testing` and `Benchmarking`,
and `msg` gave weird results for `doc` (it would say `Docing`).
  • Loading branch information
jyn514 committed May 29, 2023
commit cb4b7f631980e6f78a486be46ec653ad322ce12e
8 changes: 6 additions & 2 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -644,12 +644,16 @@ impl Kind {
}
}

pub fn test_description(&self) -> &'static str {
pub fn description(&self) -> String {
match self {
Kind::Test => "Testing",
Kind::Bench => "Benchmarking",
_ => panic!("not a test command: {}!", self.as_str()),
Kind::Doc => "Documenting",
Kind::Run => "Running",
Kind::Suggest => "Suggesting",
_ => return format!("{self:?}"),
}
.to_owned()
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,8 @@ impl Build {
host: impl Into<Option<TargetSelection>>,
target: impl Into<Option<TargetSelection>>,
) -> Option<gha::Group> {
let action = action.into();
let msg = |fmt| format!("{action:?}ing stage{stage} {what}{fmt}");
let action = action.into().description();
let msg = |fmt| format!("{action} stage{stage} {what}{fmt}");
let msg = if let Some(target) = target.into() {
let host = host.into().unwrap();
if host == target {
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl Step for CrateBootstrap {
);
builder.info(&format!(
"{} {} stage0 ({})",
builder.kind.test_description(),
builder.kind.description(),
path,
bootstrap_host,
));
Expand Down