about summary refs log tree commit diff
diff options
context:
space:
mode:
authoronur-ozkan <work@onurozkan.dev>2024-08-13 13:48:23 +0300
committeronur-ozkan <work@onurozkan.dev>2024-08-13 13:48:23 +0300
commitaba675fe7597e2aabf53d1d93d52f57aedc97dd6 (patch)
tree251b10c41a7fb43b829c688a204abf65c77376ee
parent591ecb88dffdb0f233e2fae74fd3d7c81d65ff0c (diff)
downloadrust-aba675fe7597e2aabf53d1d93d52f57aedc97dd6.tar.gz
rust-aba675fe7597e2aabf53d1d93d52f57aedc97dd6.zip
copy `builder-config` file into ci-rustc sysroot
Signed-off-by: onur-ozkan <work@onurozkan.dev>
-rw-r--r--src/bootstrap/src/core/download.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/bootstrap/src/core/download.rs b/src/bootstrap/src/core/download.rs
index 4d1aea3cd95..a88b4a33856 100644
--- a/src/bootstrap/src/core/download.rs
+++ b/src/bootstrap/src/core/download.rs
@@ -273,11 +273,12 @@ impl Config {
 
         let mut tar = tar::Archive::new(decompressor);
 
+        let is_ci_rustc = dst.ends_with("ci-rustc");
+
         // `compile::Sysroot` needs to know the contents of the `rustc-dev` tarball to avoid adding
         // it to the sysroot unless it was explicitly requested. But parsing the 100 MB tarball is slow.
         // Cache the entries when we extract it so we only have to read it once.
-        let mut recorded_entries =
-            if dst.ends_with("ci-rustc") { recorded_entries(dst, pattern) } else { None };
+        let mut recorded_entries = if is_ci_rustc { recorded_entries(dst, pattern) } else { None };
 
         for member in t!(tar.entries()) {
             let mut member = t!(member);
@@ -287,10 +288,12 @@ impl Config {
                 continue;
             }
             let mut short_path = t!(original_path.strip_prefix(directory_prefix));
-            if !short_path.starts_with(pattern) {
+            let is_builder_config = short_path.to_str() == Some("builder-config");
+
+            if !short_path.starts_with(pattern) && (is_ci_rustc && !is_builder_config) {
                 continue;
             }
-            short_path = t!(short_path.strip_prefix(pattern));
+            short_path = short_path.strip_prefix(pattern).unwrap_or(short_path);
             let dst_path = dst.join(short_path);
             self.verbose(|| {
                 println!("extracting {} to {}", original_path.display(), dst.display())