@@ -1307,6 +1307,9 @@ impl Config {
1307
1307
toml_path = config. src . join ( toml_path) ;
1308
1308
}
1309
1309
1310
+ let file_content = t ! ( fs:: read_to_string( config. src. join( "src/ci/channel" ) ) ) ;
1311
+ let ci_channel = file_content. trim_end ( ) ;
1312
+
1310
1313
// Give a hard error if `--config` or `RUST_BOOTSTRAP_CONFIG` are set to a missing path,
1311
1314
// but not if `config.toml` hasn't been created.
1312
1315
let mut toml = if !using_default_path || toml_path. exists ( ) {
@@ -1534,6 +1537,7 @@ impl Config {
1534
1537
let mut omit_git_hash = None ;
1535
1538
let mut lld_enabled = None ;
1536
1539
1540
+ let mut is_user_configured_rust_channel = false ;
1537
1541
if let Some ( rust) = toml. rust {
1538
1542
let Rust {
1539
1543
optimize : optimize_toml,
@@ -1591,15 +1595,14 @@ impl Config {
1591
1595
lld_mode,
1592
1596
} = rust;
1593
1597
1598
+ is_user_configured_rust_channel = channel. is_some ( ) ;
1594
1599
set ( & mut config. channel , channel) ;
1595
1600
1596
1601
config. download_rustc_commit = config. download_ci_rustc_commit ( download_rustc) ;
1597
1602
// This list is incomplete, please help by expanding it!
1598
1603
if config. download_rustc_commit . is_some ( ) {
1599
1604
// We need the channel used by the downloaded compiler to match the one we set for rustdoc;
1600
1605
// otherwise rustdoc-ui tests break.
1601
- let ci_channel = t ! ( fs:: read_to_string( config. src. join( "src/ci/channel" ) ) ) ;
1602
- let ci_channel = ci_channel. trim_end ( ) ;
1603
1606
if config. channel != ci_channel
1604
1607
&& !( config. channel == "dev" && ci_channel == "nightly" )
1605
1608
{
@@ -1717,6 +1720,10 @@ impl Config {
1717
1720
config. omit_git_hash = omit_git_hash. unwrap_or ( default) ;
1718
1721
config. rust_info = GitInfo :: new ( config. omit_git_hash , & config. src ) ;
1719
1722
1723
+ if config. rust_info . is_from_tarball ( ) && !is_user_configured_rust_channel {
1724
+ ci_channel. clone_into ( & mut config. channel ) ;
1725
+ }
1726
+
1720
1727
if let Some ( llvm) = toml. llvm {
1721
1728
let Llvm {
1722
1729
optimize : optimize_toml,
0 commit comments