Skip to content

Commit 8facd06

Browse files
committed
move download_beta_toolchain out of impl as its used during config initialization
1 parent 861de92 commit 8facd06

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/bootstrap/src/core/download.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,31 @@ pub(crate) fn is_download_ci_available(target_triple: &str, llvm_assertions: boo
491491
}
492492
}
493493

494+
#[cfg(test)]
495+
pub(crate) fn download_beta_toolchain<'a>(dwn_ctx: impl AsRef<DownloadContext<'a>>) {}
496+
497+
#[cfg(not(test))]
498+
pub(crate) fn download_beta_toolchain<'a>(dwn_ctx: impl AsRef<DownloadContext<'a>>) {
499+
let dwn_ctx = dwn_ctx.as_ref();
500+
if dwn_ctx.verbose {
501+
println!("downloading stage0 beta artifacts");
502+
}
503+
504+
let date = dwn_ctx.stage0_metadata.compiler.date.clone();
505+
let version = dwn_ctx.stage0_metadata.compiler.version.clone();
506+
let extra_components = ["cargo"];
507+
let sysroot = "stage0";
508+
download_toolchain(
509+
dwn_ctx,
510+
&version,
511+
sysroot,
512+
&date,
513+
&extra_components,
514+
"stage0",
515+
DownloadSource::Dist,
516+
);
517+
}
518+
494519
fn download_toolchain<'a>(
495520
dwn_ctx: impl AsRef<DownloadContext<'a>>,
496521
version: &str,

0 commit comments

Comments
 (0)