Skip to content

Fix --skip-std-check-if-no-download-rustc #143707

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 1 commit into from
Jul 11, 2025
Merged
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
14 changes: 7 additions & 7 deletions src/bootstrap/src/core/build_steps/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ impl Step for Std {
}

fn make_run(run: RunConfig<'_>) {
if !run.builder.download_rustc() && run.builder.config.skip_std_check_if_no_download_rustc {
eprintln!(
"WARNING: `--skip-std-check-if-no-download-rustc` flag was passed and `rust.download-rustc` is not available. Skipping."
);
return;
}

let crates = std_crates_for_run_make(&run);
run.builder.ensure(Std {
build_compiler: prepare_compiler_for_check(run.builder, run.target, Mode::Std),
Expand All @@ -56,13 +63,6 @@ impl Step for Std {
}

fn run(self, builder: &Builder<'_>) {
if !builder.download_rustc() && builder.config.skip_std_check_if_no_download_rustc {
eprintln!(
"WARNING: `--skip-std-check-if-no-download-rustc` flag was passed and `rust.download-rustc` is not available. Skipping."
);
return;
}

let build_compiler = self.build_compiler;
let stage = build_compiler.stage;
let target = self.target;
Expand Down
24 changes: 24 additions & 0 deletions src/bootstrap/src/core/builder/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,30 @@ mod snapshot {
");
}

/// Make sure that we don't check library when download-rustc is disabled
/// when `--skip-std-check-if-no-download-rustc` was passed.
#[test]
fn check_library_skip_without_download_rustc() {
let ctx = TestCtx::new();
let args = ["--set", "rust.download-rustc=false", "--skip-std-check-if-no-download-rustc"];
insta::assert_snapshot!(
ctx.config("check")
.paths(&["library"])
.args(&args)
.render_steps(), @"");

insta::assert_snapshot!(
ctx.config("check")
.paths(&["library", "compiler"])
.args(&args)
.render_steps(), @r"
[build] llvm <host>
[check] rustc 0 <host> -> rustc 1 <host>
[check] rustc 0 <host> -> cranelift 1 <host>
[check] rustc 0 <host> -> gcc 1 <host>
");
}

#[test]
fn check_miri_no_explicit_stage() {
let ctx = TestCtx::new();
Expand Down
Loading