From 033ea63639e11e3af2bd33092129465e4b9d8113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 30 May 2025 20:34:55 +0200 Subject: [PATCH 1/2] Do not run PGO/BOLT in x64 Linux alt builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub Beránek --- .../host-x86_64/dist-x86_64-linux/Dockerfile | 15 +++++++-------- .../host-x86_64/dist-x86_64-linux/dist-alt.sh | 8 ++++++++ .../docker/host-x86_64/dist-x86_64-linux/dist.sh | 13 +++++++++++++ src/ci/github-actions/jobs.yml | 3 +++ 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100755 src/ci/docker/host-x86_64/dist-x86_64-linux/dist-alt.sh create mode 100755 src/ci/docker/host-x86_64/dist-x86_64-linux/dist.sh diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile index bedf45c8630cf..44f6a8d2a155a 100644 --- a/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile @@ -96,14 +96,13 @@ ENV RUST_CONFIGURE_ARGS \ --set rust.lto=thin \ --set rust.codegen-units=1 -# Note that `rust.debug` is set to true *only* for `opt-dist` -ENV SCRIPT python3 ../x.py build --set rust.debug=true opt-dist && \ - ./build/$HOSTS/stage0-tools-bin/opt-dist linux-ci -- python3 ../x.py dist \ - --host $HOSTS --target $HOSTS \ - --include-default-paths \ - build-manifest bootstrap && \ - # Use GCC for building GCC, as it seems to behave badly when built with Clang - CC=/rustroot/bin/cc CXX=/rustroot/bin/c++ python3 ../x.py dist gcc +ARG SCRIPT_ARG + +COPY host-x86_64/dist-x86_64-linux/dist.sh /scripts/ +COPY host-x86_64/dist-x86_64-linux/dist-alt.sh /scripts/ + +ENV SCRIPT /scripts/${SCRIPT_ARG} + ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=clang # This is the only builder which will create source tarballs diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/dist-alt.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/dist-alt.sh new file mode 100755 index 0000000000000..8e756c32431f2 --- /dev/null +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/dist-alt.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -eux + +python3 ../x.py dist \ + --host $HOSTS --target $HOSTS \ + --include-default-paths \ + build-manifest bootstrap diff --git a/src/ci/docker/host-x86_64/dist-x86_64-linux/dist.sh b/src/ci/docker/host-x86_64/dist-x86_64-linux/dist.sh new file mode 100755 index 0000000000000..064ac5b0a5e42 --- /dev/null +++ b/src/ci/docker/host-x86_64/dist-x86_64-linux/dist.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -eux + +python3 ../x.py build --set rust.debug=true opt-dist + +./build/$HOSTS/stage0-tools-bin/opt-dist linux-ci -- python3 ../x.py dist \ + --host $HOSTS --target $HOSTS \ + --include-default-paths \ + build-manifest bootstrap + +# Use GCC for building GCC, as it seems to behave badly when built with Clang +CC=/rustroot/bin/cc CXX=/rustroot/bin/c++ python3 ../x.py dist gcc diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index dc6a0e1ebad86..56863b839dfd2 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -141,6 +141,7 @@ try: - name: dist-x86_64-linux env: CODEGEN_BACKENDS: llvm,cranelift + DOCKER_SCRIPT: dist.sh <<: *job-linux-36c-codebuild # Main CI jobs that have to be green to merge a commit into master @@ -237,12 +238,14 @@ auto: - name: dist-x86_64-linux env: CODEGEN_BACKENDS: llvm,cranelift + DOCKER_SCRIPT: dist.sh <<: *job-linux-36c-codebuild - name: dist-x86_64-linux-alt env: IMAGE: dist-x86_64-linux CODEGEN_BACKENDS: llvm,cranelift + DOCKER_SCRIPT: dist-alt.sh <<: *job-linux-16c - name: dist-x86_64-musl From 8f22a507c1e7fd7313c1421db25d80057f07bac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ber=C3=A1nek?= Date: Fri, 30 May 2025 22:13:47 +0200 Subject: [PATCH 2/2] Use 4-core large disk runner for the alt job --- src/ci/github-actions/jobs.yml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/ci/github-actions/jobs.yml b/src/ci/github-actions/jobs.yml index 56863b839dfd2..8d5f4647301bf 100644 --- a/src/ci/github-actions/jobs.yml +++ b/src/ci/github-actions/jobs.yml @@ -10,6 +10,10 @@ runners: free_disk: true <<: *base-job + - &job-linux-4c-largedisk + os: ubuntu-24.04-4core-16gb + <<: *base-job + - &job-linux-8c os: ubuntu-24.04-8core-32gb <<: *base-job @@ -107,6 +111,15 @@ envs: pr: PR_CI_JOB: 1 +jobs: + dist-x86_64-linux: &job-dist-x86_64-linux + name: dist-x86_64-linux + env: + CODEGEN_BACKENDS: llvm,cranelift + DOCKER_SCRIPT: dist.sh + <<: *job-linux-36c-codebuild + + # Jobs that run on each push to a pull request (PR) # These jobs automatically inherit envs.pr, to avoid repeating # it in each job definition. @@ -138,11 +151,7 @@ pr: # These jobs automatically inherit envs.try, to avoid repeating # it in each job definition. try: - - name: dist-x86_64-linux - env: - CODEGEN_BACKENDS: llvm,cranelift - DOCKER_SCRIPT: dist.sh - <<: *job-linux-36c-codebuild + - <<: *job-dist-x86_64-linux # Main CI jobs that have to be green to merge a commit into master # These jobs automatically inherit envs.auto, to avoid repeating @@ -235,18 +244,14 @@ auto: - name: dist-x86_64-illumos <<: *job-linux-4c - - name: dist-x86_64-linux - env: - CODEGEN_BACKENDS: llvm,cranelift - DOCKER_SCRIPT: dist.sh - <<: *job-linux-36c-codebuild + - <<: *job-dist-x86_64-linux - name: dist-x86_64-linux-alt env: IMAGE: dist-x86_64-linux CODEGEN_BACKENDS: llvm,cranelift DOCKER_SCRIPT: dist-alt.sh - <<: *job-linux-16c + <<: *job-linux-4c-largedisk - name: dist-x86_64-musl env: