Skip to content

Commit 0c6e3ac

Browse files
committed
Auto merge of #117018 - Kobzol:opt-dist-cargo-stage0, r=<try>
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](#117000 (comment)) failure.
2 parents 724ba7f + d6f831b commit 0c6e3ac

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

.github/workflows/ci.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,6 @@ jobs:
536536
try:
537537
name: "try - ${{ matrix.name }}"
538538
env:
539-
DIST_TRY_BUILD: 1
540539
CI_JOB_NAME: "${{ matrix.name }}"
541540
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse
542541
HEAD_SHA: "${{ github.event.pull_request.head.sha || github.sha }}"
@@ -553,9 +552,12 @@ jobs:
553552
strategy:
554553
matrix:
555554
include:
556-
- name: dist-x86_64-linux
557-
os: ubuntu-20.04-16core-64gb
558-
env: {}
555+
- name: dist-x86_64-msvc
556+
env:
557+
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --host=x86_64-pc-windows-msvc --target=x86_64-pc-windows-msvc --enable-full-tools --enable-profiler"
558+
SCRIPT: python x.py build --set rust.debug=true opt-dist && PGO_HOST=x86_64-pc-windows-msvc ./build/x86_64-pc-windows-msvc/stage0-tools-bin/opt-dist windows-ci -- python x.py dist bootstrap --include-default-paths
559+
DIST_REQUIRE_ALL_TOOLS: 1
560+
os: windows-2019-8core-32gb
559561
timeout-minutes: 600
560562
runs-on: "${{ matrix.os }}"
561563
steps:

src/ci/github-actions/ci.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -689,15 +689,23 @@ jobs:
689689
<<: *base-ci-job
690690
name: try - ${{ matrix.name }}
691691
env:
692-
DIST_TRY_BUILD: 1
692+
# DIST_TRY_BUILD: 1
693693
<<: [*shared-ci-variables, *prod-variables]
694694
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'))
695695
strategy:
696696
matrix:
697697
include:
698-
- &dist-x86_64-linux
699-
name: dist-x86_64-linux
700-
<<: *job-linux-16c
698+
- name: dist-x86_64-msvc
699+
env:
700+
RUST_CONFIGURE_ARGS: >-
701+
--build=x86_64-pc-windows-msvc
702+
--host=x86_64-pc-windows-msvc
703+
--target=x86_64-pc-windows-msvc
704+
--enable-full-tools
705+
--enable-profiler
706+
SCRIPT: python x.py build --set rust.debug=true opt-dist && PGO_HOST=x86_64-pc-windows-msvc ./build/x86_64-pc-windows-msvc/stage0-tools-bin/opt-dist windows-ci -- python x.py dist bootstrap --include-default-paths
707+
DIST_REQUIRE_ALL_TOOLS: 1
708+
<<: *job-windows-8c
701709

702710
master:
703711
name: master

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

+3-6
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
2424
let host_triple = env.host_triple();
2525
let version = find_dist_version(&dist_dir)?;
2626

27-
// Extract rustc, libstd, cargo and src archives to create the optimized sysroot
27+
// Extract rustc, libstd and src archives to create the optimized sysroot
2828
let rustc_dir = extract_dist_dir(&format!("rustc-{version}-{host_triple}"))?.join("rustc");
2929
let libstd_dir = extract_dist_dir(&format!("rust-std-{version}-{host_triple}"))?
3030
.join(format!("rust-std-{host_triple}"));
31-
let cargo_dir = extract_dist_dir(&format!("cargo-{version}-{host_triple}"))?.join("cargo");
3231
let extracted_src_dir = extract_dist_dir(&format!("rust-src-{version}"))?.join("rust-src");
3332

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

4847
let rustc_path = rustc_dir.join("bin").join(format!("rustc{}", executable_extension()));
4948
assert!(rustc_path.is_file());
50-
let cargo_path = cargo_dir.join("bin").join(format!("cargo{}", executable_extension()));
51-
assert!(cargo_path.is_file());
5249

5350
// Specify path to a LLVM config so that LLVM is not rebuilt.
5451
// It doesn't really matter which LLVM config we choose, because no sysroot will be compiled.
@@ -65,13 +62,11 @@ change-id = 115898
6562
6663
[build]
6764
rustc = "{rustc}"
68-
cargo = "{cargo}"
6965
7066
[target.{host_triple}]
7167
llvm-config = "{llvm_config}"
7268
"#,
7369
rustc = rustc_path.to_string().replace('\\', "/"),
74-
cargo = cargo_path.to_string().replace('\\', "/"),
7570
llvm_config = llvm_config.to_string().replace('\\', "/")
7671
);
7772
log::info!("Using following `config.toml` for running tests:\n{config_content}");
@@ -84,6 +79,8 @@ llvm-config = "{llvm_config}"
8479
env.python_binary(),
8580
x_py.as_str(),
8681
"test",
82+
"--build",
83+
env.host_triple(),
8784
"--stage",
8885
"0",
8986
"tests/assembly",

0 commit comments

Comments
 (0)