From cb87398ea7f654559799ff7f79f292842832c29c Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 20 Nov 2024 20:59:38 -0800 Subject: [PATCH 01/22] Workflows: Use new depot runners for x86 Linux release builds --- .github/workflows/release-binaries.yml | 89 +++++++++++++++++++++----- 1 file changed, 73 insertions(+), 16 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 1cde628d3f66c..eeb92f2e039b9 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -60,6 +60,8 @@ jobs: enable-pgo: ${{ steps.vars.outputs.enable-pgo }} release-binary-basename: ${{ steps.vars.outputs.release-binary-basename }} release-binary-filename: ${{ steps.vars.outputs.release-binary-filename }} + runs-on: ${{ steps.vars.outputs.runs-on }} + multi-stage: ${{ steps.vars.outputs.multi-stage }} steps: # It's good practice to use setup-python, but this is also required on macos-14 @@ -144,12 +146,26 @@ jobs: echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT echo "build-flang=$build_flang" >> $GITHUB_OUTPUT + case "${{ inputs.runs-on }}" in + ubuntu-22.04) + runs_on="depot-${{ inputs.runs-on }}-16" + multi_stage="false" + ;; + *) + runs_on="${{ inputs.runs-on }}" + multi_stage="true" + ;; + esac + echo "runs-on=$runs_on" >> $GITHUB_OUTPUT + echo "multi-stage=$multi_stage" >> $GITHUB_OUTPUT build-stage1: name: "Build Stage 1" needs: prepare - if: github.repository == 'llvm/llvm-project' - runs-on: ${{ inputs.runs-on }} + if: >- + github.repository == 'llvm/llvm-project' && + needs.prepare.outputs.multi-stage == 'true' + runs-on: ${{ needs.prepare.outputs.runs-on }} steps: - name: Checkout Actions @@ -195,7 +211,7 @@ jobs: key: sccache-${{ runner.os }}-${{ runner.arch }}-release variant: sccache - - name: Build Stage 1 Clang + - name: Configure Stage 1 Clang id: build shell: bash run: | @@ -208,12 +224,44 @@ jobs: -DBOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" \ -DCMAKE_C_COMPILER_LAUNCHER=sccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache - ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build - # There is a race condition on the MacOS builders and this command is here - # to help debug that when it happens. - ls -ltr ${{ steps.setup-stage.outputs.build-prefix }}/build + - name: Build Stage 1 Clang + shell: bash + run: | + if "${{ steps.needs.prepare.outputs.multi-stage}}" = "true"; then + ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package + mv ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/${{ needs.prepare.outputs.release-binary-filename }} . + else + ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build + # There is a race condition on the MacOS builders and this command is here + # to help debug that when it happens. + ls -ltr ${{ steps.setup-stage.outputs.build-prefix }}/build + fi + + - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0 + if: needs.prepare.outputs.multi-stage == "false" + with: + name: ${{ runner.os }}-${{ runner.arch }}-release-binary + # Due to path differences on Windows when running in bash vs running on node, + # we need to search for files in the current workspace. + path: | + ${{ needs.prepare.outputs.release-binary-filename }} + + # Clean up some build files to reduce size of artifact. + - name: Clean Up Build Directory + if: needs.prepare.outputs.multi-stage == "false" + shell: bash + run: | + find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname ${{ needs.prepare.outputs.release-binary-filename }} -delete + rm -Rf ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/_CPack_Packages + - name: Run Tests + shell: bash + if: needs.prepare.outputs.multi-stage == "false" + run: | + ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-check-all + - name: Save Stage + if: needs.prepare.outputs.multi-stage == "true" uses: ./workflows-main/.github/workflows/release-binaries-save-stage with: build-prefix: ${{ steps.setup-stage.outputs.build-prefix }} @@ -223,8 +271,10 @@ jobs: needs: - prepare - build-stage1 - if: github.repository == 'llvm/llvm-project' - runs-on: ${{ inputs.runs-on }} + if: >- + github.repository == 'llvm/llvm-project' && + needs.prepare.outputs.multi-stage == 'true' + runs-on: ${{ needs.prepare.outputs.runs-on }} steps: - name: Checkout Actions uses: actions/checkout@v4 @@ -242,7 +292,9 @@ jobs: - name: Build Stage 2 # Re-enable once PGO builds are supported. - if: needs.prepare.outputs.enable-pgo == 'true' + if: >- + needs.prepare.outputs.enable-pgo == 'true' && + needs.prepare.outputs.multi-stage == 'true' shell: bash run: | ninja -C ${{ steps.setup-stage.outputs.build-prefix}}/build stage2-instrumented @@ -257,8 +309,10 @@ jobs: needs: - prepare - build-stage2 - if: github.repository == 'llvm/llvm-project' - runs-on: ${{ inputs.runs-on }} + if: >- + github.repository == 'llvm/llvm-project' && + needs.prepare.outputs.multi-stage == 'true' + runs-on: ${{ needs.prepare.outputs.runs-on }} steps: - name: Checkout Actions uses: actions/checkout@v4 @@ -307,7 +361,9 @@ jobs: needs: - prepare - build-stage3-clang - runs-on: ${{ inputs.runs-on }} + if: >- + needs.prepare.outputs.multi-stage == 'true' + runs-on: ${{ needs.prepare.outputs.runs-on }} steps: - name: Checkout Actions uses: actions/checkout@v4 @@ -357,7 +413,7 @@ jobs: needs: - prepare - build-stage3-flang - runs-on: ${{ inputs.runs-on }} + runs-on: ${{ needs.prepare.outputs.runs-on }} steps: - name: Checkout Actions uses: actions/checkout@v4 @@ -409,6 +465,7 @@ jobs: needs: - prepare - build-stage3-all + - build-stage1 if: >- always() && github.event_name != 'pull_request' && @@ -469,8 +526,8 @@ jobs: - prepare - build-stage3-all if: >- - github.repository == 'llvm/llvm-project' - runs-on: ${{ inputs.runs-on }} + github.repository == 'llvm/llvm-project' && + runs-on: ${{ needs.prepare.outputs.runs-on }} steps: - name: Checkout Actions uses: actions/checkout@v4 From e0373d6b57b6a8ce2bb11ab54ea699311dbe88bf Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 20 Nov 2024 21:10:48 -0800 Subject: [PATCH 02/22] Fix up some typos --- .github/workflows/release-binaries.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index eeb92f2e039b9..82e9faaa0333f 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -227,7 +227,7 @@ jobs: - name: Build Stage 1 Clang shell: bash run: | - if "${{ steps.needs.prepare.outputs.multi-stage}}" = "true"; then + if [ "${{ steps.needs.prepare.outputs.multi-stage}}" = "true" ]; then ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package mv ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/${{ needs.prepare.outputs.release-binary-filename }} . else @@ -238,7 +238,7 @@ jobs: fi - uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 #v4.3.0 - if: needs.prepare.outputs.multi-stage == "false" + if: needs.prepare.outputs.multi-stage == 'false' with: name: ${{ runner.os }}-${{ runner.arch }}-release-binary # Due to path differences on Windows when running in bash vs running on node, @@ -248,7 +248,7 @@ jobs: # Clean up some build files to reduce size of artifact. - name: Clean Up Build Directory - if: needs.prepare.outputs.multi-stage == "false" + if: needs.prepare.outputs.multi-stage == 'false' shell: bash run: | find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname ${{ needs.prepare.outputs.release-binary-filename }} -delete @@ -256,12 +256,12 @@ jobs: - name: Run Tests shell: bash - if: needs.prepare.outputs.multi-stage == "false" + if: needs.prepare.outputs.multi-stage == 'false' run: | ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-check-all - name: Save Stage - if: needs.prepare.outputs.multi-stage == "true" + if: needs.prepare.outputs.multi-stage == 'true' uses: ./workflows-main/.github/workflows/release-binaries-save-stage with: build-prefix: ${{ steps.setup-stage.outputs.build-prefix }} From 6568444066258c9873edf484dbd6793bc847087a Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 20 Nov 2024 21:11:46 -0800 Subject: [PATCH 03/22] Fix another typo --- .github/workflows/release-binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 82e9faaa0333f..8e9bd5b9a7449 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -526,7 +526,7 @@ jobs: - prepare - build-stage3-all if: >- - github.repository == 'llvm/llvm-project' && + github.repository == 'llvm/llvm-project' runs-on: ${{ needs.prepare.outputs.runs-on }} steps: - name: Checkout Actions From 1702aa6534b32dd8af52dbf2d0f1e9615ee4361f Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 20 Nov 2024 21:14:17 -0800 Subject: [PATCH 04/22] Fix wrong if condition --- .github/workflows/release-binaries.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 8e9bd5b9a7449..dc7bf5906da02 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -163,8 +163,7 @@ jobs: name: "Build Stage 1" needs: prepare if: >- - github.repository == 'llvm/llvm-project' && - needs.prepare.outputs.multi-stage == 'true' + github.repository == 'llvm/llvm-project' runs-on: ${{ needs.prepare.outputs.runs-on }} steps: From 72ff71f64661243c6782f63c1a64f6d7084f9afe Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 20 Nov 2024 21:18:37 -0800 Subject: [PATCH 05/22] Fix multi-stage condition --- .github/workflows/release-binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index dc7bf5906da02..bd96d2b27f604 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -226,7 +226,7 @@ jobs: - name: Build Stage 1 Clang shell: bash run: | - if [ "${{ steps.needs.prepare.outputs.multi-stage}}" = "true" ]; then + if [ "${{ steps.needs.prepare.outputs.multi-stage}}" = "false" ]; then ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package mv ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/${{ needs.prepare.outputs.release-binary-filename }} . else From e2ac546d0a5fc6a4b34f4797fec8b10b96e4dcba Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Wed, 20 Nov 2024 21:39:17 -0800 Subject: [PATCH 06/22] Fix variable name --- .github/workflows/release-binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index bd96d2b27f604..790817103db3f 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -226,7 +226,7 @@ jobs: - name: Build Stage 1 Clang shell: bash run: | - if [ "${{ steps.needs.prepare.outputs.multi-stage}}" = "false" ]; then + if [ "${{ needs.prepare.outputs.multi-stage}}" = "false" ]; then ninja -v -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-package mv ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/${{ needs.prepare.outputs.release-binary-filename }} . else From 137ed986d4995291959f0d58594a9ea0c6af2023 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 21 Nov 2024 07:01:54 -0800 Subject: [PATCH 07/22] Split out tests job --- .github/workflows/release-binaries.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 790817103db3f..0ed4546920f11 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -253,14 +253,7 @@ jobs: find ${{ steps.setup-stage.outputs.build-prefix }}/build -iname ${{ needs.prepare.outputs.release-binary-filename }} -delete rm -Rf ${{ steps.setup-stage.outputs.build-prefix }}/build/tools/clang/stage2-bins/_CPack_Packages - - name: Run Tests - shell: bash - if: needs.prepare.outputs.multi-stage == 'false' - run: | - ninja -C ${{ steps.setup-stage.outputs.build-prefix }}/build stage2-check-all - - name: Save Stage - if: needs.prepare.outputs.multi-stage == 'true' uses: ./workflows-main/.github/workflows/release-binaries-save-stage with: build-prefix: ${{ steps.setup-stage.outputs.build-prefix }} @@ -525,8 +518,9 @@ jobs: - prepare - build-stage3-all if: >- + always() && github.repository == 'llvm/llvm-project' - runs-on: ${{ needs.prepare.outputs.runs-on }} + runs-on: ${{ input.runs-on }} steps: - name: Checkout Actions uses: actions/checkout@v4 @@ -540,7 +534,7 @@ jobs: id: setup-stage uses: ./workflows/.github/workflows/release-binaries-setup-stage with: - previous-artifact: build-stage3-all + previous-artifact: ${{ (needs.prepare.outputs.multi-stage == 'false' && 'build-stage1') || 'build-stage3-all' }} - name: Run Tests shell: bash From 605e497f79aad69c3856a6f071b45a1b6a4aa574 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Thu, 21 Nov 2024 07:06:03 -0800 Subject: [PATCH 08/22] Fix typo --- .github/workflows/release-binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 0ed4546920f11..9c9b947a7014b 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -520,7 +520,7 @@ jobs: if: >- always() && github.repository == 'llvm/llvm-project' - runs-on: ${{ input.runs-on }} + runs-on: ${{ inputs.runs-on }} steps: - name: Checkout Actions uses: actions/checkout@v4 From c60000d63df59b545f2cb28e3431e9e2cad8b59c Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 22 Nov 2024 09:30:47 -0800 Subject: [PATCH 09/22] Add sccache to test stage --- .github/workflows/release-binaries.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 9c9b947a7014b..7a3f6870ebe29 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -536,6 +536,16 @@ jobs: with: previous-artifact: ${{ (needs.prepare.outputs.multi-stage == 'false' && 'build-stage1') || 'build-stage3-all' }} + # Need sccache installed, because some stage1 objects are being built for the tests. + # FIXME: This probably shouldn't be happening. + - name: Setup sccache + uses: hendrikmuhs/ccache-action@ca3acd2731eef11f1572ccb126356c2f9298d35e # v1.2.9 + with: + # Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174 + max-size: 2G + key: sccache-${{ runner.os }}-${{ runner.arch }}-release + variant: sccache + - name: Run Tests shell: bash run: | From 76675cb5e666b4f365755f1b8042ff96e771f7e9 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 20 Dec 2024 09:29:08 -0800 Subject: [PATCH 10/22] linux-release-pgo --- .github/workflows/release-binaries.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 7a3f6870ebe29..1fcf57814374c 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -122,7 +122,11 @@ jobs: # Detect necessary CMake flags target="${{ runner.os }}-${{ runner.arch }}" - echo "enable-pgo=false" >> $GITHUB_OUTPUT + if [ "${{ runner.os }}" = "Linux" ]; then + echo "enable-pgo=true" >> $GITHUB_OUTPUT + else + echo "enable-pgo=false" >> $GITHUB_OUTPUT + fi target_cmake_flags="-DLLVM_RELEASE_ENABLE_PGO=OFF" # The macOS builds try to cross compile some libraries so we need to # add extra CMake args to disable them. From 2fca06377d0a972ac0f5dbc21a25107058a70e6f Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 20 Dec 2024 09:30:26 -0800 Subject: [PATCH 11/22] Disable pgo --- .github/workflows/release-binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 1fcf57814374c..eceb068593580 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -126,8 +126,8 @@ jobs: echo "enable-pgo=true" >> $GITHUB_OUTPUT else echo "enable-pgo=false" >> $GITHUB_OUTPUT + target_cmake_flags="-DLLVM_RELEASE_ENABLE_PGO=OFF" fi - target_cmake_flags="-DLLVM_RELEASE_ENABLE_PGO=OFF" # The macOS builds try to cross compile some libraries so we need to # add extra CMake args to disable them. # See https://github.com/llvm/llvm-project/issues/99767 From 5aa1a47ac8dcb05e1a24f48fc37d92a86e13db1f Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 20 Dec 2024 11:08:04 -0800 Subject: [PATCH 12/22] Add arm binaries on Linux --- .github/workflows/release-binaries-all.yml | 1 + .github/workflows/release-binaries.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-binaries-all.yml b/.github/workflows/release-binaries-all.yml index f5318aecc53a7..8dbf745fa6af6 100644 --- a/.github/workflows/release-binaries-all.yml +++ b/.github/workflows/release-binaries-all.yml @@ -83,6 +83,7 @@ jobs: matrix: runs-on: - ubuntu-22.04 + - ubuntu-22.04-arm - windows-2022 - macos-13 - macos-14 diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index eceb068593580..b21d045977cf6 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -151,7 +151,7 @@ jobs: echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT echo "build-flang=$build_flang" >> $GITHUB_OUTPUT case "${{ inputs.runs-on }}" in - ubuntu-22.04) + ubuntu-22.04*) runs_on="depot-${{ inputs.runs-on }}-16" multi_stage="false" ;; From dc72a8ad333a2a8cb2bf22362e03b08a3c4dc137 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 20 Dec 2024 16:17:12 -0800 Subject: [PATCH 13/22] Fix arm --- .github/workflows/release-binaries-all.yml | 2 +- .github/workflows/release-binaries.yml | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-binaries-all.yml b/.github/workflows/release-binaries-all.yml index 8dbf745fa6af6..ed58a3ee67366 100644 --- a/.github/workflows/release-binaries-all.yml +++ b/.github/workflows/release-binaries-all.yml @@ -83,7 +83,7 @@ jobs: matrix: runs-on: - ubuntu-22.04 - - ubuntu-22.04-arm + - depot-ubuntu-22.04-arm-small - windows-2022 - macos-13 - macos-14 diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index b21d045977cf6..d8bbe2dda56bc 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -18,6 +18,7 @@ on: type: choice options: - ubuntu-22.04 + - depot-ubuntu-22.04-arm-small - windows-2022 - macos-13 - macos-14 @@ -151,10 +152,14 @@ jobs: echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT echo "build-flang=$build_flang" >> $GITHUB_OUTPUT case "${{ inputs.runs-on }}" in - ubuntu-22.04*) + ubuntu-22.04) runs_on="depot-${{ inputs.runs-on }}-16" multi_stage="false" ;; + depot-ubuntu-22.04-arm-small) + runs_on="depot-ubuntu-22.04-arm-16" + multi_stage="false" + ;; *) runs_on="${{ inputs.runs-on }}" multi_stage="true" From cf8f5665eaa6d6921df63935ccfbe3b6395d65f9 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 20 Dec 2024 17:57:53 -0800 Subject: [PATCH 14/22] Use ccache for arm64 linux --- .github/workflows/release-binaries.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index d8bbe2dda56bc..7151caa6b4080 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -57,6 +57,7 @@ jobs: ref: ${{ steps.vars.outputs.ref }} upload: ${{ steps.vars.outputs.upload }} target-cmake-flags: ${{ steps.vars.outputs.target-cmake-flags }} + ccache: ${{ steps.vars.outputs.ccache }} build-flang: ${{ steps.vars.outputs.build-flang }} enable-pgo: ${{ steps.vars.outputs.enable-pgo }} release-binary-basename: ${{ steps.vars.outputs.release-binary-basename }} @@ -123,6 +124,15 @@ jobs: # Detect necessary CMake flags target="${{ runner.os }}-${{ runner.arch }}" + + # The hendrikmuhs/ccache-action action does not support installing sccache + # on arm64 Linux. + if [ "$target" = "Linux-ARM64" ]; + echo ccache=ccache >> $GITHUB_OUTPUT + else + echo ccache=sccache >> $GITHUB_OUTPUT + fi + if [ "${{ runner.os }}" = "Linux" ]; then echo "enable-pgo=true" >> $GITHUB_OUTPUT else @@ -216,8 +226,8 @@ jobs: with: # Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174 max-size: 2G - key: sccache-${{ runner.os }}-${{ runner.arch }}-release - variant: sccache + key: ${{ needs.prepare.outputs.ccache }}-${{ runner.os }}-${{ runner.arch }}-release + variant: ${{ needs.prepare.outputs.ccache }} - name: Configure Stage 1 Clang id: build @@ -230,8 +240,8 @@ jobs: -C clang/cmake/caches/Release.cmake \ -DBOOTSTRAP_LLVM_PARALLEL_LINK_JOBS=1 \ -DBOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" \ - -DCMAKE_C_COMPILER_LAUNCHER=sccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=sccache + -DCMAKE_C_COMPILER_LAUNCHER=${{ needs.prepare.outputs.ccache }} \ + -DCMAKE_CXX_COMPILER_LAUNCHER=${{ needs.prepare.outputs.ccache }} - name: Build Stage 1 Clang shell: bash run: | @@ -552,8 +562,8 @@ jobs: with: # Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174 max-size: 2G - key: sccache-${{ runner.os }}-${{ runner.arch }}-release - variant: sccache + key: ${{ needs.prepare.outputs.ccache }}-${{ runner.os }}-${{ runner.arch }}-release + variant: ${{ needs.prepare.outputs.ccache }} - name: Run Tests shell: bash From 065341f6d907d6a91f8aa71a197dd4792c4fe609 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 20 Dec 2024 21:01:51 -0800 Subject: [PATCH 15/22] Fix typo --- .github/workflows/release-binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 7151caa6b4080..4e718d3a4f1da 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -127,7 +127,7 @@ jobs: # The hendrikmuhs/ccache-action action does not support installing sccache # on arm64 Linux. - if [ "$target" = "Linux-ARM64" ]; + if [ "$target" = "Linux-ARM64" ]; then echo ccache=ccache >> $GITHUB_OUTPUT else echo ccache=sccache >> $GITHUB_OUTPUT From 232248bf408d75561eca075c1a15db84f9d3201b Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 20 Dec 2024 21:10:35 -0800 Subject: [PATCH 16/22] Fix ninja install on Linux --- .github/workflows/release-binaries-setup-stage/action.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/release-binaries-setup-stage/action.yml b/.github/workflows/release-binaries-setup-stage/action.yml index f5e5db27e6595..080342ffa10e7 100644 --- a/.github/workflows/release-binaries-setup-stage/action.yml +++ b/.github/workflows/release-binaries-setup-stage/action.yml @@ -22,7 +22,14 @@ runs: using: "composite" steps: - name: Install Ninja + # This doesn't seem to work on Ubuntu any more, so just use apt-get + if: runner.os != 'Linux' uses: llvm/actions/install-ninja@22e9f909d35b50bd1181709564bfe816eaeaae81 # main + + - name: Install Ninja (Linux) + if: runner.os == 'Linux' + run: | + sudo apt-get -y install ninja - name: Setup Windows if: startsWith(runner.os, 'Windows') From 4a398523495115ad926b4c531db8dcbe8ddb0522 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 20 Dec 2024 21:19:19 -0800 Subject: [PATCH 17/22] Fix ninja install part 2 --- .github/workflows/release-binaries-setup-stage/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-binaries-setup-stage/action.yml b/.github/workflows/release-binaries-setup-stage/action.yml index 080342ffa10e7..4856ec297bd38 100644 --- a/.github/workflows/release-binaries-setup-stage/action.yml +++ b/.github/workflows/release-binaries-setup-stage/action.yml @@ -28,6 +28,7 @@ runs: - name: Install Ninja (Linux) if: runner.os == 'Linux' + shell: bash run: | sudo apt-get -y install ninja From 23244ea7a1c53a6a4cddd2012602b71e416d8792 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 20 Dec 2024 21:28:13 -0800 Subject: [PATCH 18/22] Fix ninja install --- .github/workflows/release-binaries-setup-stage/action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-binaries-setup-stage/action.yml b/.github/workflows/release-binaries-setup-stage/action.yml index 4856ec297bd38..14baaf1039a31 100644 --- a/.github/workflows/release-binaries-setup-stage/action.yml +++ b/.github/workflows/release-binaries-setup-stage/action.yml @@ -30,7 +30,8 @@ runs: if: runner.os == 'Linux' shell: bash run: | - sudo apt-get -y install ninja + sudo apt-get update + sudo apt-get -y install ninja-build - name: Setup Windows if: startsWith(runner.os, 'Windows') From 712789dba375bafe862fd80f29344c50449f5369 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 20 Jan 2025 17:18:41 -0800 Subject: [PATCH 19/22] Try to run install-ninja --- .github/workflows/release-binaries-setup-stage/action.yml | 4 ++-- .github/workflows/release-binaries.yml | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-binaries-setup-stage/action.yml b/.github/workflows/release-binaries-setup-stage/action.yml index 14baaf1039a31..a9dda9cb1c20c 100644 --- a/.github/workflows/release-binaries-setup-stage/action.yml +++ b/.github/workflows/release-binaries-setup-stage/action.yml @@ -23,11 +23,11 @@ runs: steps: - name: Install Ninja # This doesn't seem to work on Ubuntu any more, so just use apt-get - if: runner.os != 'Linux' + if: true || runner.os != 'Linux' uses: llvm/actions/install-ninja@22e9f909d35b50bd1181709564bfe816eaeaae81 # main - name: Install Ninja (Linux) - if: runner.os == 'Linux' + if: false && runner.os == 'Linux' shell: bash run: | sudo apt-get update diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 046bd1b4558f6..2ea22b6b66088 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -121,9 +121,6 @@ jobs: echo "release-binary-basename=$release_binary_basename" >> $GITHUB_OUTPUT echo "release-binary-filename=$release_binary_basename.tar.xz" >> $GITHUB_OUTPUT - # Detect necessary CMake flags - target="${{ runner.os }}-${{ runner.arch }}" - # The hendrikmuhs/ccache-action action does not support installing sccache # on arm64 Linux. if [ "$target" = "Linux-ARM64" ]; then From f0f4e8723b27b4135f260b0ce0452fd7710f1dab Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 21 Jan 2025 08:59:59 -0800 Subject: [PATCH 20/22] Some fixups --- .github/workflows/release-binaries-all.yml | 2 +- .../workflows/release-binaries-setup-stage/action.yml | 9 --------- .github/workflows/release-binaries.yml | 3 +-- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-binaries-all.yml b/.github/workflows/release-binaries-all.yml index ceb07636e2e3b..d18b9b0b5c2ff 100644 --- a/.github/workflows/release-binaries-all.yml +++ b/.github/workflows/release-binaries-all.yml @@ -83,7 +83,7 @@ jobs: matrix: runs-on: - ubuntu-22.04 - - depot-ubuntu-22.04-arm-small + - ubuntu-22.04-arm - macos-13 - macos-14 diff --git a/.github/workflows/release-binaries-setup-stage/action.yml b/.github/workflows/release-binaries-setup-stage/action.yml index a9dda9cb1c20c..f5e5db27e6595 100644 --- a/.github/workflows/release-binaries-setup-stage/action.yml +++ b/.github/workflows/release-binaries-setup-stage/action.yml @@ -22,16 +22,7 @@ runs: using: "composite" steps: - name: Install Ninja - # This doesn't seem to work on Ubuntu any more, so just use apt-get - if: true || runner.os != 'Linux' uses: llvm/actions/install-ninja@22e9f909d35b50bd1181709564bfe816eaeaae81 # main - - - name: Install Ninja (Linux) - if: false && runner.os == 'Linux' - shell: bash - run: | - sudo apt-get update - sudo apt-get -y install ninja-build - name: Setup Windows if: startsWith(runner.os, 'Windows') diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 2ea22b6b66088..f492a27d2fd52 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -18,7 +18,7 @@ on: type: choice options: - ubuntu-22.04 - - depot-ubuntu-22.04-arm-small + - ubuntu-22.04-arm - macos-13 - macos-14 @@ -336,7 +336,6 @@ jobs: - prepare - build-release-package if: >- - always() && github.repository == 'llvm/llvm-project' runs-on: ${{ needs.prepare.outputs.test-runs-on }} steps: From 9843b3d4481ed3d14b695a3cae0c9fde89ec0bc8 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 21 Jan 2025 09:09:27 -0800 Subject: [PATCH 21/22] Fixups --- .github/workflows/release-binaries.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index f492a27d2fd52..41fea3b8d58a4 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -121,6 +121,7 @@ jobs: echo "release-binary-basename=$release_binary_basename" >> $GITHUB_OUTPUT echo "release-binary-filename=$release_binary_basename.tar.xz" >> $GITHUB_OUTPUT + target="$RUNNER_OS-$RUNNER_ARCH" # The hendrikmuhs/ccache-action action does not support installing sccache # on arm64 Linux. if [ "$target" = "Linux-ARM64" ]; then @@ -129,7 +130,7 @@ jobs: echo ccache=sccache >> $GITHUB_OUTPUT fi - target="$RUNNER_OS-$RUNNER_ARCH" + # Detect necessary CMake flags echo "enable-pgo=false" >> $GITHUB_OUTPUT target_cmake_flags="-DLLVM_RELEASE_ENABLE_PGO=OFF" # The macOS builds try to cross compile some libraries so we need to @@ -155,7 +156,7 @@ jobs: echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT echo "build-flang=$build_flang" >> $GITHUB_OUTPUT case "${{ inputs.runs-on }}" in - ubuntu-22.04) + ubuntu-22.04*) build_runs_on="depot-${{ inputs.runs-on }}-16" test_runs_on=$build_runs_on ;; From ec799e442f647355da8e514125a2fe48c3f35a5a Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Tue, 21 Jan 2025 09:20:01 -0800 Subject: [PATCH 22/22] Fix CCACHE on arm --- .github/workflows/release-binaries.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-binaries.yml b/.github/workflows/release-binaries.yml index 41fea3b8d58a4..1898e1fd04dcd 100644 --- a/.github/workflows/release-binaries.yml +++ b/.github/workflows/release-binaries.yml @@ -237,6 +237,8 @@ jobs: - name: Configure id: build shell: bash + env: + CCACHE_BIN: ${{ needs.prepare.outputs.ccache }} run: | # There were some issues on the ARM64 MacOS runners with trying to build x86 object, # so we need to set some extra cmake flags to disable this. @@ -245,8 +247,8 @@ jobs: -C clang/cmake/caches/Release.cmake \ -DBOOTSTRAP_LLVM_PARALLEL_LINK_JOBS=1 \ -DBOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" \ - -DCMAKE_C_COMPILER_LAUNCHER=sccache \ - -DCMAKE_CXX_COMPILER_LAUNCHER=sccache + -DCMAKE_C_COMPILER_LAUNCHER=$CCACHE_BIN \ + -DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_BIN - name: Build shell: bash run: |