From aaa4e541ee1ce764eb58f848563bca0b8a330f72 Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Fri, 27 Oct 2023 18:56:46 +0000 Subject: 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. --- src/bootstrap/src/core/build_steps/dist.rs | 4 +++- src/ci/github-actions/ci.yml | 10 ++++++++++ src/ci/run.sh | 6 ++++-- 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index acab3cffe07..b578c5ec295 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -1624,7 +1624,9 @@ impl Step for Extended { prepare(tool); } } - prepare("rustc-codegen-cranelift"); + if builder.config.rust_codegen_backends.contains(&INTERNER.intern_str("cranelift")) { + prepare("rustc-codegen-cranelift"); + } // create an 'uninstall' package builder.install(&etc.join("pkg/postinstall"), &pkg.join("uninstall"), 0o755); pkgbuild("uninstall"); diff --git a/src/ci/github-actions/ci.yml b/src/ci/github-actions/ci.yml index 2577682c57c..bbba6600581 100644 --- a/src/ci/github-actions/ci.yml +++ b/src/ci/github-actions/ci.yml @@ -359,6 +359,8 @@ jobs: <<: *job-linux-8c - name: dist-aarch64-linux + env: + CODEGEN_BACKENDS: llvm,cranelift <<: *job-linux-8c - name: dist-android @@ -411,14 +413,19 @@ jobs: - &dist-x86_64-linux name: dist-x86_64-linux + env: + CODEGEN_BACKENDS: llvm,cranelift <<: *job-linux-16c - name: dist-x86_64-linux-alt env: IMAGE: dist-x86_64-linux + CODEGEN_BACKENDS: llvm,cranelift <<: *job-linux-16c - name: dist-x86_64-musl + env: + CODEGEN_BACKENDS: llvm,cranelift <<: *job-linux-8c - name: dist-x86_64-netbsd @@ -501,6 +508,7 @@ jobs: NO_DEBUG_ASSERTIONS: 1 NO_OVERFLOW_CHECKS: 1 DIST_REQUIRE_ALL_TOOLS: 1 + CODEGEN_BACKENDS: llvm,cranelift <<: *job-macos-xl - name: dist-apple-various @@ -697,6 +705,8 @@ jobs: include: - &dist-x86_64-linux name: dist-x86_64-linux + env: + CODEGEN_BACKENDS: llvm,cranelift <<: *job-linux-16c master: diff --git a/src/ci/run.sh b/src/ci/run.sh index bcfe1fc0410..9a63bb5c91c 100755 --- a/src/ci/run.sh +++ b/src/ci/run.sh @@ -84,8 +84,6 @@ if [ "$DIST_SRC" = "" ]; then RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-dist-src" fi -RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-backends=llvm,cranelift" - # Always set the release channel for bootstrap; this is normally not important (i.e., only dist # builds would seem to matter) but in practice bootstrap wants to know whether we're targeting # 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 RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir" fi + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-backends=${CODEGEN_BACKENDS:-llvm}" else # We almost always want debug assertions enabled, but sometimes this takes too # long for too little benefit, so we just turn them off. @@ -127,6 +126,9 @@ else RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.verify-llvm-ir" + # Test the Cranelift backend in CI. Bootstrap knows which targets to run tests on. + RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.codegen-backends=llvm,cranelift" + # We enable this for non-dist builders, since those aren't trying to produce # fresh binaries. We currently don't entirely support distributing a fresh # copy of the compiler (including llvm tools, etc.) if we haven't actually -- cgit 1.4.1-3-g733a5