Skip to content

Commit 143d813

Browse files
committed
implement new x flag: --skip-std-check-if-no-download-rustc
Signed-off-by: onur-ozkan <[email protected]>
1 parent 99426c5 commit 143d813

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/bootstrap/src/core/build_steps/check.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,13 @@ impl Step for Std {
6060
}
6161

6262
fn run(self, builder: &Builder<'_>) {
63+
if !builder.download_rustc() && builder.config.skip_std_check_if_no_download_rustc {
64+
eprintln!(
65+
"WARNING: `--skip-std-check-if-no-download-rustc` flag was passed and `rust.download-rustc` is not available. Skipping."
66+
);
67+
return;
68+
}
69+
6370
builder.require_submodule("library/stdarch", None);
6471

6572
let target = self.target;

src/bootstrap/src/core/config/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,9 @@ pub struct Config {
423423

424424
/// Cache for determining path modifications
425425
pub path_modification_cache: Arc<Mutex<HashMap<Vec<&'static str>, PathFreshness>>>,
426+
427+
/// Skip checking std if `rust.download-rustc` isn't available.
428+
pub skip_std_check_if_no_download_rustc: bool,
426429
}
427430

428431
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
@@ -1507,6 +1510,7 @@ impl Config {
15071510
config.enable_bolt_settings = flags.enable_bolt_settings;
15081511
config.bypass_bootstrap_lock = flags.bypass_bootstrap_lock;
15091512
config.is_running_on_ci = flags.ci.unwrap_or(CiEnv::is_ci());
1513+
config.skip_std_check_if_no_download_rustc = flags.skip_std_check_if_no_download_rustc;
15101514

15111515
// Infer the rest of the configuration.
15121516

src/bootstrap/src/core/config/flags.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ pub struct Flags {
182182
/// Make bootstrap to behave as it's running on the CI environment or not.
183183
#[arg(global = true, long, value_name = "bool")]
184184
pub ci: Option<bool>,
185+
/// Skip checking std if `rust.download-rustc` isn't available.
186+
#[arg(global = true, long)]
187+
pub skip_std_check_if_no_download_rustc: bool,
185188
}
186189

187190
impl Flags {

0 commit comments

Comments
 (0)