@@ -1312,6 +1312,13 @@ impl Config {
1312
1312
git
1313
1313
}
1314
1314
1315
+ pub ( crate ) fn artifact_channel ( & self , commit : & str ) -> String {
1316
+ let mut channel = self . git ( ) ;
1317
+ channel. arg ( "show" ) . arg ( format ! ( "{}:src/ci/channel" , commit) ) ;
1318
+ let channel = output ( & mut channel) ;
1319
+ channel. trim ( ) . to_owned ( )
1320
+ }
1321
+
1315
1322
/// Try to find the relative path of `bindir`, otherwise return it in full.
1316
1323
pub fn bindir_relative ( & self ) -> & Path {
1317
1324
let bindir = & self . bindir ;
@@ -1547,8 +1554,7 @@ fn maybe_download_rustfmt(builder: &Builder<'_>) -> Option<PathBuf> {
1547
1554
1548
1555
fn download_ci_rustc ( builder : & Builder < ' _ > , commit : & str ) {
1549
1556
builder. verbose ( & format ! ( "using downloaded stage2 artifacts from CI (commit {commit})" ) ) ;
1550
- // FIXME: support downloading artifacts from the beta channel
1551
- const CHANNEL : & str = "nightly" ;
1557
+ let channel = builder. config . artifact_channel ( commit) ;
1552
1558
let host = builder. config . build . triple ;
1553
1559
let bin_root = builder. out . join ( host) . join ( "ci-rustc" ) ;
1554
1560
let rustc_stamp = bin_root. join ( ".rustc-stamp" ) ;
@@ -1557,13 +1563,13 @@ fn download_ci_rustc(builder: &Builder<'_>, commit: &str) {
1557
1563
if bin_root. exists ( ) {
1558
1564
t ! ( fs:: remove_dir_all( & bin_root) ) ;
1559
1565
}
1560
- let filename = format ! ( "rust-std-{CHANNEL }-{host}.tar.xz" ) ;
1566
+ let filename = format ! ( "rust-std-{channel }-{host}.tar.xz" ) ;
1561
1567
let pattern = format ! ( "rust-std-{host}" ) ;
1562
1568
download_ci_component ( builder, filename, & pattern, commit) ;
1563
- let filename = format ! ( "rustc-{CHANNEL }-{host}.tar.xz" ) ;
1569
+ let filename = format ! ( "rustc-{channel }-{host}.tar.xz" ) ;
1564
1570
download_ci_component ( builder, filename, "rustc" , commit) ;
1565
1571
// download-rustc doesn't need its own cargo, it can just use beta's.
1566
- let filename = format ! ( "rustc-dev-{CHANNEL }-{host}.tar.xz" ) ;
1572
+ let filename = format ! ( "rustc-dev-{channel }-{host}.tar.xz" ) ;
1567
1573
download_ci_component ( builder, filename, "rustc-dev" , commit) ;
1568
1574
1569
1575
builder. fix_bin_or_dylib ( & bin_root. join ( "bin" ) . join ( "rustc" ) ) ;
0 commit comments