@@ -1312,6 +1312,13 @@ impl Config {
13121312 git
13131313 }
13141314
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+
13151322 /// Try to find the relative path of `bindir`, otherwise return it in full.
13161323 pub fn bindir_relative ( & self ) -> & Path {
13171324 let bindir = & self . bindir ;
@@ -1547,8 +1554,7 @@ fn maybe_download_rustfmt(builder: &Builder<'_>) -> Option<PathBuf> {
15471554
15481555fn download_ci_rustc ( builder : & Builder < ' _ > , commit : & str ) {
15491556 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) ;
15521558 let host = builder. config . build . triple ;
15531559 let bin_root = builder. out . join ( host) . join ( "ci-rustc" ) ;
15541560 let rustc_stamp = bin_root. join ( ".rustc-stamp" ) ;
@@ -1557,13 +1563,13 @@ fn download_ci_rustc(builder: &Builder<'_>, commit: &str) {
15571563 if bin_root. exists ( ) {
15581564 t ! ( fs:: remove_dir_all( & bin_root) ) ;
15591565 }
1560- let filename = format ! ( "rust-std-{CHANNEL }-{host}.tar.xz" ) ;
1566+ let filename = format ! ( "rust-std-{channel }-{host}.tar.xz" ) ;
15611567 let pattern = format ! ( "rust-std-{host}" ) ;
15621568 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" ) ;
15641570 download_ci_component ( builder, filename, "rustc" , commit) ;
15651571 // 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" ) ;
15671573 download_ci_component ( builder, filename, "rustc-dev" , commit) ;
15681574
15691575 builder. fix_bin_or_dylib ( & bin_root. join ( "bin" ) . join ( "rustc" ) ) ;
0 commit comments