Skip to content

Commit aba675f

Browse files
committed
copy builder-config file into ci-rustc sysroot
Signed-off-by: onur-ozkan <work@onurozkan.dev>
1 parent 591ecb8 commit aba675f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/bootstrap/src/core/download.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,12 @@ impl Config {
273273

274274
let mut tar = tar::Archive::new(decompressor);
275275

276+
let is_ci_rustc = dst.ends_with("ci-rustc");
277+
276278
// `compile::Sysroot` needs to know the contents of the `rustc-dev` tarball to avoid adding
277279
// it to the sysroot unless it was explicitly requested. But parsing the 100 MB tarball is slow.
278280
// Cache the entries when we extract it so we only have to read it once.
279-
let mut recorded_entries =
280-
if dst.ends_with("ci-rustc") { recorded_entries(dst, pattern) } else { None };
281+
let mut recorded_entries = if is_ci_rustc { recorded_entries(dst, pattern) } else { None };
281282

282283
for member in t!(tar.entries()) {
283284
let mut member = t!(member);
@@ -287,10 +288,12 @@ impl Config {
287288
continue;
288289
}
289290
let mut short_path = t!(original_path.strip_prefix(directory_prefix));
290-
if !short_path.starts_with(pattern) {
291+
let is_builder_config = short_path.to_str() == Some("builder-config");
292+
293+
if !short_path.starts_with(pattern) && (is_ci_rustc && !is_builder_config) {
291294
continue;
292295
}
293-
short_path = t!(short_path.strip_prefix(pattern));
296+
short_path = short_path.strip_prefix(pattern).unwrap_or(short_path);
294297
let dst_path = dst.join(short_path);
295298
self.verbose(|| {
296299
println!("extracting {} to {}", original_path.display(), dst.display())

0 commit comments

Comments
 (0)