Skip to content

add new config: rust.download_rustc_incompatibility_check #142055

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

Closed
wants to merge 3 commits into from
Closed
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
3 changes: 3 additions & 0 deletions bootstrap.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,9 @@
# compiler.
#download-rustc = false

# Whether to check and detect incompatible options when using download-rustc.
#download_rustc_incompatibility_check = true

# Number of codegen units to use for each compiler invocation. A value of 0
# means "the number of cores on this machine", and 1+ is passed through to the
# compiler.
Expand Down
10 changes: 9 additions & 1 deletion src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ pub struct Config {

/// Cache for determining path modifications
pub path_modification_cache: Arc<Mutex<HashMap<Vec<&'static str>, PathFreshness>>>,

/// Whether to check and detect incompatible options when using download-rustc.
pub download_rustc_incompatibility_check: bool,
}

#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)]
Expand Down Expand Up @@ -1315,6 +1318,7 @@ define_config! {
profile_use: Option<String> = "profile-use",
// ignored; this is set from an env var set by bootstrap.py
download_rustc: Option<StringOrBool> = "download-rustc",
download_rustc_incompatibility_check: Option<bool> = "download-rustc-incompatibility-check",
lto: Option<String> = "lto",
validate_mir_opts: Option<u32> = "validate-mir-opts",
std_features: Option<BTreeSet<String>> = "std-features",
Expand Down Expand Up @@ -2041,6 +2045,7 @@ impl Config {
strip,
lld_mode,
std_features: std_features_toml,
download_rustc_incompatibility_check,
} = rust;

// FIXME(#133381): alt rustc builds currently do *not* have rustc debug assertions
Expand Down Expand Up @@ -2086,6 +2091,8 @@ impl Config {
debuginfo_level_std = debuginfo_level_std_toml;
debuginfo_level_tools = debuginfo_level_tools_toml;
debuginfo_level_tests = debuginfo_level_tests_toml;
config.download_rustc_incompatibility_check =
download_rustc_incompatibility_check.unwrap_or(true);
lld_enabled = lld_enabled_toml;
std_features = std_features_toml;

Expand Down Expand Up @@ -2789,7 +2796,7 @@ impl Config {
}
}

if let Some(config_path) = &self.config {
if let Some(config_path) = &self.config && self.download_rustc_incompatibility_check {
let ci_config_toml = match self.get_builder_toml("ci-rustc") {
Ok(ci_config_toml) => ci_config_toml,
Err(e) if e.to_string().contains("unknown field") => {
Expand Down Expand Up @@ -3555,6 +3562,7 @@ fn check_incompatible_options_for_ci_rustc(
download_rustc: _,
validate_mir_opts: _,
frame_pointers: _,
download_rustc_incompatibility_check: _,
} = ci_rust_config;

// There are two kinds of checks for CI rustc incompatible options:
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/utils/change_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,4 +416,9 @@ pub const CONFIG_CHANGE_HISTORY: &[ChangeInfo] = &[
severity: ChangeSeverity::Warning,
summary: "Stage0 library no longer matches the in-tree library, which means stage1 compiler now uses the beta library.",
},
ChangeInfo {
change_id: 142055,
severity: ChangeSeverity::Info,
summary: "Added a new option `rust.download_rustc_incompatibility_check`: it is now possible to disable the config incompatibility check for `download-rustc` usage.",
},
];
Loading