Skip to content

Commit 72fcca2

Browse files
committed
Auto merge of #134131 - jieyouxu:exp-bootstrap-test, r=<try>
[DO NOT MERGE][BETA] What does compiletest see in opt-dist? Does try jobs even work against beta...? r? `@ghost` try-job: dist-x86_64-linux
2 parents 202008a + 41d70a3 commit 72fcca2

File tree

5 files changed

+28
-2
lines changed

5 files changed

+28
-2
lines changed

src/ci/github-actions/jobs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ envs:
7979
# - not running `opt-dist`'s post-optimization smoke tests on the resulting toolchain
8080
#
8181
# If you *want* these to happen however, temporarily uncomment it before triggering a try build.
82-
DIST_TRY_BUILD: 1
82+
#DIST_TRY_BUILD: 1
8383

8484
auto:
8585
<<: *production

src/tools/compiletest/src/main.rs

+10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ fn main() {
1818

1919
let config = Arc::new(parse_config(env::args().collect()));
2020

21+
eprintln!("INFO: compiletest was told channel=`{}`", config.channel);
22+
eprintln!("INFO: rustc -vV reports:");
23+
eprintln!(
24+
"{}",
25+
String::from_utf8(
26+
std::process::Command::new(&config.rustc_path).arg("-vV").output().unwrap().stdout
27+
)
28+
.unwrap()
29+
);
30+
2131
if !config.has_html_tidy && config.mode == Mode::Rustdoc {
2232
eprintln!("warning: `tidy` (html-tidy.org) is not installed; diffs will not be generated");
2333
}

src/tools/opt-dist/src/tests.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
2525
let host_triple = env.host_tuple();
2626
let version = find_dist_version(&dist_dir)?;
2727

28+
let channel = version_to_channel(&version);
29+
2830
// Extract rustc, libstd, cargo and src archives to create the optimized sysroot
2931
let rustc_dir = extract_dist_dir(&format!("rustc-{version}-{host_triple}"))?.join("rustc");
3032
let libstd_dir = extract_dist_dir(&format!("rust-std-{version}-{host_triple}"))?
@@ -61,9 +63,13 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
6163
assert!(llvm_config.is_file());
6264

6365
let config_content = format!(
64-
r#"profile = "user"
66+
r#"
67+
profile = "user"
6568
change-id = 115898
6669
70+
[rust]
71+
channel = "{channel}"
72+
6773
[build]
6874
rustc = "{rustc}"
6975
cargo = "{cargo}"
@@ -116,3 +122,13 @@ fn find_dist_version(directory: &Utf8Path) -> anyhow::Result<String> {
116122
archive.strip_prefix("reproducible-artifacts-").unwrap().split_once('-').unwrap();
117123
Ok(version.to_string())
118124
}
125+
126+
/// Roughly convert a version string (`nightly`, `beta`, or `1.XY.Z`) to channel string (`nightly`,
127+
/// `beta` or `stable`).
128+
fn version_to_channel(version_str: &str) -> &'static str {
129+
match version_str {
130+
"nightly" => "nightly",
131+
"beta" => "beta",
132+
_ => "stable",
133+
}
134+
}

0 commit comments

Comments
 (0)