1818 type : choice
1919 options :
2020 - ubuntu-22.04
21+ - ubuntu-22.04-arm
2122 - macos-13
2223 - macos-14
2324
5556 ref : ${{ steps.vars.outputs.ref }}
5657 upload : ${{ steps.vars.outputs.upload }}
5758 target-cmake-flags : ${{ steps.vars.outputs.target-cmake-flags }}
59+ ccache : ${{ steps.vars.outputs.ccache }}
5860 build-flang : ${{ steps.vars.outputs.build-flang }}
5961 enable-pgo : ${{ steps.vars.outputs.enable-pgo }}
6062 release-binary-basename : ${{ steps.vars.outputs.release-binary-basename }}
@@ -119,8 +121,16 @@ jobs:
119121 echo "release-binary-basename=$release_binary_basename" >> $GITHUB_OUTPUT
120122 echo "release-binary-filename=$release_binary_basename.tar.xz" >> $GITHUB_OUTPUT
121123
122- # Detect necessary CMake flags
123124 target="$RUNNER_OS-$RUNNER_ARCH"
125+ # The hendrikmuhs/ccache-action action does not support installing sccache
126+ # on arm64 Linux.
127+ if [ "$target" = "Linux-ARM64" ]; then
128+ echo ccache=ccache >> $GITHUB_OUTPUT
129+ else
130+ echo ccache=sccache >> $GITHUB_OUTPUT
131+ fi
132+
133+ # Detect necessary CMake flags
124134 echo "enable-pgo=false" >> $GITHUB_OUTPUT
125135 target_cmake_flags="-DLLVM_RELEASE_ENABLE_PGO=OFF"
126136 # The macOS builds try to cross compile some libraries so we need to
@@ -146,7 +156,7 @@ jobs:
146156 echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
147157 echo "build-flang=$build_flang" >> $GITHUB_OUTPUT
148158 case "${{ inputs.runs-on }}" in
149- ubuntu-22.04)
159+ ubuntu-22.04* )
150160 build_runs_on="depot-${{ inputs.runs-on }}-16"
151161 test_runs_on=$build_runs_on
152162 ;;
@@ -221,12 +231,14 @@ jobs:
221231 with :
222232 # Default to 2G to workaround: https://github.com/hendrikmuhs/ccache-action/issues/174
223233 max-size : 2G
224- key : sccache -${{ runner.os }}-${{ runner.arch }}-release
225- variant : sccache
234+ key : ${{ needs.prepare.outputs.ccache }} -${{ runner.os }}-${{ runner.arch }}-release
235+ variant : ${{ needs.prepare.outputs.ccache }}
226236
227237 - name : Configure
228238 id : build
229239 shell : bash
240+ env :
241+ CCACHE_BIN : ${{ needs.prepare.outputs.ccache }}
230242 run : |
231243 # There were some issues on the ARM64 MacOS runners with trying to build x86 object,
232244 # so we need to set some extra cmake flags to disable this.
@@ -235,8 +247,8 @@ jobs:
235247 -C clang/cmake/caches/Release.cmake \
236248 -DBOOTSTRAP_LLVM_PARALLEL_LINK_JOBS=1 \
237249 -DBOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}" \
238- -DCMAKE_C_COMPILER_LAUNCHER=sccache \
239- -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
250+ -DCMAKE_C_COMPILER_LAUNCHER=$CCACHE_BIN \
251+ -DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_BIN
240252 - name : Build
241253 shell : bash
242254 run : |
0 commit comments