about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorTanvi Pooranmal Meena <tanvimeena19@gmail.com>2025-01-13 15:38:39 +0530
committerTanvi Pooranmal Meena <tanvimeena19@gmail.com>2025-01-20 11:07:32 +0530
commit7d806171d00f53a720e6784a878a98cbef5c3d4a (patch)
treeb505866a17d27babec90ccd0b6479560582af955 /src
parent39dc268459b4bd8b771e500169bea67850fad30d (diff)
downloadrust-7d806171d00f53a720e6784a878a98cbef5c3d4a.tar.gz
rust-7d806171d00f53a720e6784a878a98cbef5c3d4a.zip
Add logic to override profile for non git sources
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/bootstrap.py5
-rw-r--r--src/bootstrap/src/core/config/config.rs6
2 files changed, 7 insertions, 4 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 76ee40c6f45..74923af1555 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -1268,6 +1268,11 @@ def bootstrap(args):
         config_toml = ""
 
     profile = RustBuild.get_toml_static(config_toml, "profile")
+    is_non_git_source = not os.path.exists(os.path.join(rust_root, ".git"))
+
+    if profile is None and is_non_git_source:
+        profile = "dist"
+
     if profile is not None:
         # Allows creating alias for profile names, allowing
         # profiles to be renamed while maintaining back compatibility
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
index 1c49063ef5c..a09902a4c38 100644
--- a/src/bootstrap/src/core/config/config.rs
+++ b/src/bootstrap/src/core/config/config.rs
@@ -2926,10 +2926,8 @@ impl Config {
         let if_unchanged = || {
             if self.rust_info.is_from_tarball() {
                 // Git is needed for running "if-unchanged" logic.
-                println!(
-                    "WARNING: 'if-unchanged' has no effect on tarball sources; ignoring `download-ci-llvm`."
-                );
-                return false;
+                println!("ERROR: 'if-unchanged' is only compatible with Git managed sources.");
+                crate::exit!(1);
             }
 
             // Fetching the LLVM submodule is unnecessary for self-tests.