Skip to content

Commit

Permalink
Auto merge of #134131 - jieyouxu:exp-bootstrap-test, r=<try>
Browse files Browse the repository at this point in the history
[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
  • Loading branch information
bors committed Dec 19, 2024
2 parents 202008a + 41d70a3 commit 72fcca2
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ci/github-actions/jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ envs:
# - not running `opt-dist`'s post-optimization smoke tests on the resulting toolchain
#
# If you *want* these to happen however, temporarily uncomment it before triggering a try build.
DIST_TRY_BUILD: 1
#DIST_TRY_BUILD: 1

auto:
<<: *production
Expand Down
10 changes: 10 additions & 0 deletions src/tools/compiletest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ fn main() {

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

eprintln!("INFO: compiletest was told channel=`{}`", config.channel);
eprintln!("INFO: rustc -vV reports:");
eprintln!(
"{}",
String::from_utf8(
std::process::Command::new(&config.rustc_path).arg("-vV").output().unwrap().stdout
)
.unwrap()
);

if !config.has_html_tidy && config.mode == Mode::Rustdoc {
eprintln!("warning: `tidy` (html-tidy.org) is not installed; diffs will not be generated");
}
Expand Down
18 changes: 17 additions & 1 deletion src/tools/opt-dist/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
let host_triple = env.host_tuple();
let version = find_dist_version(&dist_dir)?;

let channel = version_to_channel(&version);

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

let config_content = format!(
r#"profile = "user"
r#"
profile = "user"
change-id = 115898
[rust]
channel = "{channel}"
[build]
rustc = "{rustc}"
cargo = "{cargo}"
Expand Down Expand Up @@ -116,3 +122,13 @@ fn find_dist_version(directory: &Utf8Path) -> anyhow::Result<String> {
archive.strip_prefix("reproducible-artifacts-").unwrap().split_once('-').unwrap();
Ok(version.to_string())
}

/// Roughly convert a version string (`nightly`, `beta`, or `1.XY.Z`) to channel string (`nightly`,
/// `beta` or `stable`).
fn version_to_channel(version_str: &str) -> &'static str {
match version_str {
"nightly" => "nightly",
"beta" => "beta",
_ => "stable",
}
}
File renamed without changes.

0 comments on commit 72fcca2

Please sign in to comment.