Skip to content

Commit aaa4e54

Browse files
committed
Explicitly mark which targets to distribute cg_clif for in CI
This avoids needlessly building cg_clif for other targets and makes it easier for the dist code to determine if it should distribute cg_clif as component.
1 parent d89582c commit aaa4e54

File tree

4 files changed

+27
-7
lines changed

4 files changed

+27
-7
lines changed

Diff for: .github/workflows/ci.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ jobs:
193193
os: ubuntu-20.04-8core-32gb
194194
env: {}
195195
- name: dist-aarch64-linux
196+
env:
197+
CODEGEN_BACKENDS: "llvm,cranelift"
196198
os: ubuntu-20.04-8core-32gb
197-
env: {}
198199
- name: dist-android
199200
os: ubuntu-20.04-8core-32gb
200201
env: {}
@@ -244,15 +245,18 @@ jobs:
244245
os: ubuntu-20.04-8core-32gb
245246
env: {}
246247
- name: dist-x86_64-linux
248+
env:
249+
CODEGEN_BACKENDS: "llvm,cranelift"
247250
os: ubuntu-20.04-16core-64gb
248-
env: {}
249251
- name: dist-x86_64-linux-alt
250252
env:
251253
IMAGE: dist-x86_64-linux
254+
CODEGEN_BACKENDS: "llvm,cranelift"
252255
os: ubuntu-20.04-16core-64gb
253256
- name: dist-x86_64-musl
257+
env:
258+
CODEGEN_BACKENDS: "llvm,cranelift"
254259
os: ubuntu-20.04-8core-32gb
255-
env: {}
256260
- name: dist-x86_64-netbsd
257261
os: ubuntu-20.04-8core-32gb
258262
env: {}
@@ -316,6 +320,7 @@ jobs:
316320
NO_DEBUG_ASSERTIONS: 1
317321
NO_OVERFLOW_CHECKS: 1
318322
DIST_REQUIRE_ALL_TOOLS: 1
323+
CODEGEN_BACKENDS: "llvm,cranelift"
319324
os: macos-13
320325
- name: dist-apple-various
321326
env:
@@ -554,8 +559,9 @@ jobs:
554559
matrix:
555560
include:
556561
- name: dist-x86_64-linux
562+
env:
563+
CODEGEN_BACKENDS: "llvm,cranelift"
557564
os: ubuntu-20.04-16core-64gb
558-
env: {}
559565
timeout-minutes: 600
560566
runs-on: "${{ matrix.os }}"
561567
steps:

Diff for: src/bootstrap/src/core/build_steps/dist.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,9 @@ impl Step for Extended {
16241624
prepare(tool);
16251625
}
16261626
}
1627-
prepare("rustc-codegen-cranelift");
1627+
if builder.config.rust_codegen_backends.contains(&INTERNER.intern_str("cranelift")) {
1628+
prepare("rustc-codegen-cranelift");
1629+
}
16281630
// create an 'uninstall' package
16291631
builder.install(&etc.join("pkg/postinstall"), &pkg.join("uninstall"), 0o755);
16301632
pkgbuild("uninstall");

Diff for: src/ci/github-actions/ci.yml

+10
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ jobs:
359359
<<: *job-linux-8c
360360

361361
- name: dist-aarch64-linux
362+
env:
363+
CODEGEN_BACKENDS: llvm,cranelift
362364
<<: *job-linux-8c
363365

364366
- name: dist-android
@@ -411,14 +413,19 @@ jobs:
411413

412414
- &dist-x86_64-linux
413415
name: dist-x86_64-linux
416+
env:
417+
CODEGEN_BACKENDS: llvm,cranelift
414418
<<: *job-linux-16c
415419

416420
- name: dist-x86_64-linux-alt
417421
env:
418422
IMAGE: dist-x86_64-linux
423+
CODEGEN_BACKENDS: llvm,cranelift
419424
<<: *job-linux-16c
420425

421426
- name: dist-x86_64-musl
427+
env:
428+
CODEGEN_BACKENDS: llvm,cranelift
422429
<<: *job-linux-8c
423430

424431
- name: dist-x86_64-netbsd
@@ -501,6 +508,7 @@ jobs:
501508
NO_DEBUG_ASSERTIONS: 1
502509
NO_OVERFLOW_CHECKS: 1
503510
DIST_REQUIRE_ALL_TOOLS: 1
511+
CODEGEN_BACKENDS: llvm,cranelift
504512
<<: *job-macos-xl
505513

506514
- name: dist-apple-various
@@ -697,6 +705,8 @@ jobs:
697705
include:
698706
- &dist-x86_64-linux
699707
name: dist-x86_64-linux
708+
env:
709+
CODEGEN_BACKENDS: llvm,cranelift
700710
<<: *job-linux-16c
701711

702712
master:

Diff for: src/ci/run.sh

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ if [ "$DIST_SRC" = "" ]; then
8484
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-dist-src"
8585
fi
8686

87-
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-backends=llvm,cranelift"
88-
8987
# Always set the release channel for bootstrap; this is normally not important (i.e., only dist
9088
# builds would seem to matter) but in practice bootstrap wants to know whether we're targeting
9189
# master, beta, or stable with a build to determine whether to run some checks (notably toolstate).
@@ -107,6 +105,7 @@ if [ "$DEPLOY$DEPLOY_ALT" = "1" ]; then
107105
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir"
108106
fi
109107

108+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-backends=${CODEGEN_BACKENDS:-llvm}"
110109
else
111110
# We almost always want debug assertions enabled, but sometimes this takes too
112111
# long for too little benefit, so we just turn them off.
@@ -127,6 +126,9 @@ else
127126

128127
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir"
129128

129+
# Test the Cranelift backend in CI. Bootstrap knows which targets to run tests on.
130+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-backends=llvm,cranelift"
131+
130132
# We enable this for non-dist builders, since those aren't trying to produce
131133
# fresh binaries. We currently don't entirely support distributing a fresh
132134
# copy of the compiler (including llvm tools, etc.) if we haven't actually

0 commit comments

Comments
 (0)