implement new x flag: --skip-std-check-if-no-download-rustc

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
onur-ozkan 2025-06-03 19:12:51 +03:00
parent 99426c570e
commit 143d81362b
3 changed files with 14 additions and 0 deletions

View file

@ -60,6 +60,13 @@ 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;
}
builder.require_submodule("library/stdarch", None);
let target = self.target;

View file

@ -423,6 +423,9 @@ pub struct Config {
/// Cache for determining path modifications
pub path_modification_cache: Arc<Mutex<HashMap<Vec<&'static str>, PathFreshness>>>,
/// Skip checking std if `rust.download-rustc` isn't available.
pub skip_std_check_if_no_download_rustc: bool,
}
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
@ -1507,6 +1510,7 @@ impl Config {
config.enable_bolt_settings = flags.enable_bolt_settings;
config.bypass_bootstrap_lock = flags.bypass_bootstrap_lock;
config.is_running_on_ci = flags.ci.unwrap_or(CiEnv::is_ci());
config.skip_std_check_if_no_download_rustc = flags.skip_std_check_if_no_download_rustc;
// Infer the rest of the configuration.

View file

@ -182,6 +182,9 @@ pub struct Flags {
/// Make bootstrap to behave as it's running on the CI environment or not.
#[arg(global = true, long, value_name = "bool")]
pub ci: Option<bool>,
/// Skip checking std if `rust.download-rustc` isn't available.
#[arg(global = true, long)]
pub skip_std_check_if_no_download_rustc: bool,
}
impl Flags {