Skip to content

Commit

Permalink
Auto merge of rust-lang#117018 - Kobzol:opt-dist-cargo-stage0, r=<try>
Browse files Browse the repository at this point in the history
Use beta cargo in opt-dist

Using the new stage2 cargo caused issues when a backwards-incompatible change was made to cargo. This means that we won't be testing the LTO/1-CGU optimized cargo, but I don't think that's a big issue, as we primarily want to test the compiler.

Should fix [this](rust-lang#117000 (comment)) failure.
  • Loading branch information
bors committed Oct 21, 2023
2 parents 6f97d83 + 9a07348 commit f1a7780
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ jobs:
try:
name: "try - ${{ matrix.name }}"
env:
DIST_TRY_BUILD: 1
CI_JOB_NAME: "${{ matrix.name }}"
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
HEAD_SHA: "${{ github.event.pull_request.head.sha || github.sha }}"
Expand Down
2 changes: 1 addition & 1 deletion src/ci/github-actions/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ jobs:
<<: *base-ci-job
name: try - ${{ matrix.name }}
env:
DIST_TRY_BUILD: 1
# DIST_TRY_BUILD: 1
<<: [*shared-ci-variables, *prod-variables]
if: github.event_name == 'push' && (((github.ref == 'refs/heads/try' || github.ref == 'refs/heads/try-perf') && github.repository == 'rust-lang-ci/rust') || ((github.ref == 'refs/heads/automation/bors/try') && github.repository == 'rust-lang/rust'))
strategy:
Expand Down
7 changes: 1 addition & 6 deletions src/tools/opt-dist/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
let host_triple = env.host_triple();
let version = find_dist_version(&dist_dir)?;

// Extract rustc, libstd, cargo and src archives to create the optimized sysroot
// Extract rustc, libstd 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}"))?
.join(format!("rust-std-{host_triple}"));
let cargo_dir = extract_dist_dir(&format!("cargo-{version}-{host_triple}"))?.join("cargo");
let extracted_src_dir = extract_dist_dir(&format!("rust-src-{version}"))?.join("rust-src");

// We need to manually copy libstd to the extracted rustc sysroot
Expand All @@ -47,8 +46,6 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {

let rustc_path = rustc_dir.join("bin").join(format!("rustc{}", executable_extension()));
assert!(rustc_path.is_file());
let cargo_path = cargo_dir.join("bin").join(format!("cargo{}", executable_extension()));
assert!(cargo_path.is_file());

// Specify path to a LLVM config so that LLVM is not rebuilt.
// It doesn't really matter which LLVM config we choose, because no sysroot will be compiled.
Expand All @@ -65,13 +62,11 @@ change-id = 115898
[build]
rustc = "{rustc}"
cargo = "{cargo}"
[target.{host_triple}]
llvm-config = "{llvm_config}"
"#,
rustc = rustc_path.to_string().replace('\\', "/"),
cargo = cargo_path.to_string().replace('\\', "/"),
llvm_config = llvm_config.to_string().replace('\\', "/")
);
log::info!("Using following `config.toml` for running tests:\n{config_content}");
Expand Down

0 comments on commit f1a7780

Please sign in to comment.