@@ -1280,11 +1280,21 @@ impl Config {
1280
1280
git
1281
1281
}
1282
1282
1283
- pub ( crate ) fn artifact_channel ( & self , commit : & str ) -> String {
1283
+ pub ( crate ) fn artifact_version_part ( & self , commit : & str ) -> String {
1284
1284
let mut channel = self . git ( ) ;
1285
1285
channel. arg ( "show" ) . arg ( format ! ( "{}:src/ci/channel" , commit) ) ;
1286
1286
let channel = output ( & mut channel) ;
1287
- channel. trim ( ) . to_owned ( )
1287
+
1288
+ let mut version = self . git ( ) ;
1289
+ version. arg ( "show" ) . arg ( format ! ( "{}:src/version" , commit) ) ;
1290
+ let version = output ( & mut version) ;
1291
+
1292
+ match channel. trim ( ) {
1293
+ "stable" => version. trim ( ) . to_owned ( ) ,
1294
+ "beta" => channel. trim ( ) . to_owned ( ) ,
1295
+ "nightly" => channel. trim ( ) . to_owned ( ) ,
1296
+ other => unreachable ! ( "{:?} is not recognized as a valid channel" , other) ,
1297
+ }
1288
1298
}
1289
1299
1290
1300
/// Try to find the relative path of `bindir`, otherwise return it in full.
@@ -1526,7 +1536,7 @@ fn maybe_download_rustfmt(builder: &Builder<'_>) -> Option<PathBuf> {
1526
1536
1527
1537
fn download_ci_rustc ( builder : & Builder < ' _ > , commit : & str ) {
1528
1538
builder. verbose ( & format ! ( "using downloaded stage2 artifacts from CI (commit {commit})" ) ) ;
1529
- let channel = builder. config . artifact_channel ( commit) ;
1539
+ let version = builder. config . artifact_version_part ( commit) ;
1530
1540
let host = builder. config . build . triple ;
1531
1541
let bin_root = builder. out . join ( host) . join ( "ci-rustc" ) ;
1532
1542
let rustc_stamp = bin_root. join ( ".rustc-stamp" ) ;
@@ -1535,13 +1545,13 @@ fn download_ci_rustc(builder: &Builder<'_>, commit: &str) {
1535
1545
if bin_root. exists ( ) {
1536
1546
t ! ( fs:: remove_dir_all( & bin_root) ) ;
1537
1547
}
1538
- let filename = format ! ( "rust-std-{channel }-{host}.tar.xz" ) ;
1548
+ let filename = format ! ( "rust-std-{version }-{host}.tar.xz" ) ;
1539
1549
let pattern = format ! ( "rust-std-{host}" ) ;
1540
1550
download_ci_component ( builder, filename, & pattern, commit) ;
1541
- let filename = format ! ( "rustc-{channel }-{host}.tar.xz" ) ;
1551
+ let filename = format ! ( "rustc-{version }-{host}.tar.xz" ) ;
1542
1552
download_ci_component ( builder, filename, "rustc" , commit) ;
1543
1553
// download-rustc doesn't need its own cargo, it can just use beta's.
1544
- let filename = format ! ( "rustc-dev-{channel }-{host}.tar.xz" ) ;
1554
+ let filename = format ! ( "rustc-dev-{version }-{host}.tar.xz" ) ;
1545
1555
download_ci_component ( builder, filename, "rustc-dev" , commit) ;
1546
1556
1547
1557
builder. fix_bin_or_dylib ( & bin_root. join ( "bin" ) . join ( "rustc" ) ) ;
0 commit comments