[llvm] Depot runners arm (PR #120786)

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 20 17:58:27 PST 2024


https://github.com/tstellar updated https://github.com/llvm/llvm-project/pull/120786

>From cb87398ea7f654559799ff7f79f292842832c29c Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Wed, 20 Nov 2024 20:59:38 -0800
Subject: [PATCH 01/14] 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 1cde628d3f66c3..eeb92f2e039b98 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 at 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 at 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 at 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 at 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 at 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 at v4

>From e0373d6b57b6a8ce2bb11ab54ea699311dbe88bf Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Wed, 20 Nov 2024 21:10:48 -0800
Subject: [PATCH 02/14] 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 eeb92f2e039b98..82e9faaa0333fb 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 at 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 <tstellar at redhat.com>
Date: Wed, 20 Nov 2024 21:11:46 -0800
Subject: [PATCH 03/14] 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 82e9faaa0333fb..8e9bd5b9a7449d 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 <tstellar at redhat.com>
Date: Wed, 20 Nov 2024 21:14:17 -0800
Subject: [PATCH 04/14] 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 8e9bd5b9a7449d..dc7bf5906da029 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 <tstellar at redhat.com>
Date: Wed, 20 Nov 2024 21:18:37 -0800
Subject: [PATCH 05/14] 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 dc7bf5906da029..bd96d2b27f6044 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 <tstellar at redhat.com>
Date: Wed, 20 Nov 2024 21:39:17 -0800
Subject: [PATCH 06/14] 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 bd96d2b27f6044..790817103db3f0 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 <tstellar at redhat.com>
Date: Thu, 21 Nov 2024 07:01:54 -0800
Subject: [PATCH 07/14] 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 790817103db3f0..0ed4546920f118 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 at 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 <tstellar at redhat.com>
Date: Thu, 21 Nov 2024 07:06:03 -0800
Subject: [PATCH 08/14] 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 0ed4546920f118..9c9b947a7014bc 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 at v4

>From c60000d63df59b545f2cb28e3431e9e2cad8b59c Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar at redhat.com>
Date: Fri, 22 Nov 2024 09:30:47 -0800
Subject: [PATCH 09/14] 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 9c9b947a7014bc..7a3f6870ebe291 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 at 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 <tstellar at redhat.com>
Date: Fri, 20 Dec 2024 09:29:08 -0800
Subject: [PATCH 10/14] 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 7a3f6870ebe291..1fcf57814374c0 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 <tstellar at redhat.com>
Date: Fri, 20 Dec 2024 09:30:26 -0800
Subject: [PATCH 11/14] 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 1fcf57814374c0..eceb0685935807 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 <tstellar at redhat.com>
Date: Fri, 20 Dec 2024 11:08:04 -0800
Subject: [PATCH 12/14] 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 f5318aecc53a7f..8dbf745fa6af6e 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 eceb0685935807..b21d045977cf68 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 <tstellar at redhat.com>
Date: Fri, 20 Dec 2024 16:17:12 -0800
Subject: [PATCH 13/14] 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 8dbf745fa6af6e..ed58a3ee673661 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 b21d045977cf68..d8bbe2dda56bc5 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 <tstellar at redhat.com>
Date: Fri, 20 Dec 2024 17:57:53 -0800
Subject: [PATCH 14/14] 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 d8bbe2dda56bc5..7151caa6b4080d 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



More information about the llvm-commits mailing list