File tree 1 file changed +17
-1
lines changed
src/bootstrap/src/core/config
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -1718,7 +1718,23 @@ impl Config {
1718
1718
config. omit_git_hash = omit_git_hash. unwrap_or ( default) ;
1719
1719
config. rust_info = GitInfo :: new ( config. omit_git_hash , & config. src ) ;
1720
1720
1721
- if config. rust_info . is_from_tarball ( ) && !is_user_configured_rust_channel {
1721
+ // We need to override `rust.channel` if it's manually specified when using the CI rustc.
1722
+ // This is because if the compiler uses a different channel than the one specified in config.toml,
1723
+ // tests may fail due to using a different channel than the one used by the compiler during tests.
1724
+ if let Some ( commit) = & config. download_rustc_commit {
1725
+ if is_user_configured_rust_channel {
1726
+ println ! (
1727
+ "WARNING: `rust.download-rustc` is enabled. The `rust.channel` option will be overridden by the CI rustc's channel."
1728
+ ) ;
1729
+
1730
+ let channel = config
1731
+ . read_file_by_commit ( & PathBuf :: from ( "src/ci/channel" ) , commit)
1732
+ . trim ( )
1733
+ . to_owned ( ) ;
1734
+
1735
+ config. channel = channel;
1736
+ }
1737
+ } else if config. rust_info . is_from_tarball ( ) && !is_user_configured_rust_channel {
1722
1738
ci_channel. clone_into ( & mut config. channel ) ;
1723
1739
}
1724
1740
You can’t perform that action at this time.
0 commit comments