Skip to content

Commit bdd88dd

Browse files
authored
Rollup merge of #135433 - tanvincible:patch-1, r=onur-ozkan
Add Profile Override for Non-Git Sources ## PR description - Fixes #135358 This PR introduces the following updates to 1. `bootstrap.py`: - If the `profile` is `None` and the source is non-git, the `profile` is automatically overridden to `"dist"`. - Ensures that options like `download-ci-llvm` and `download-rustc` are not used with non-git sources. An exception is raised if these options are present in the configuration when the source is non-git. 2. `bootstrap_test.py` - Added unit tests to verify both the profile override mechanism and the assertion for restricted options. These tests ensure the correct behavior for non-git sources and the handling of `if-unchanged` options. r? `@onur-ozkan` `@rustbot` T-bootstrap
2 parents b5741a3 + 7d80617 commit bdd88dd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/bootstrap/bootstrap.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,6 +1268,11 @@ def bootstrap(args):
12681268
config_toml = ""
12691269

12701270
profile = RustBuild.get_toml_static(config_toml, "profile")
1271+
is_non_git_source = not os.path.exists(os.path.join(rust_root, ".git"))
1272+
1273+
if profile is None and is_non_git_source:
1274+
profile = "dist"
1275+
12711276
if profile is not None:
12721277
# Allows creating alias for profile names, allowing
12731278
# profiles to be renamed while maintaining back compatibility

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,10 +2931,8 @@ impl Config {
29312931
let if_unchanged = || {
29322932
if self.rust_info.is_from_tarball() {
29332933
// Git is needed for running "if-unchanged" logic.
2934-
println!(
2935-
"WARNING: 'if-unchanged' has no effect on tarball sources; ignoring `download-ci-llvm`."
2936-
);
2937-
return false;
2934+
println!("ERROR: 'if-unchanged' is only compatible with Git managed sources.");
2935+
crate::exit!(1);
29382936
}
29392937

29402938
// Fetching the LLVM submodule is unnecessary for self-tests.

0 commit comments

Comments
 (0)