Skip to content

workflows/release-binaries: Enable builds on Linux/AArch64 #120786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Jan 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release-binaries-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ jobs:
matrix:
runs-on:
- ubuntu-22.04
- ubuntu-22.04-arm
- macos-13
- macos-14

Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
type: choice
options:
- ubuntu-22.04
- ubuntu-22.04-arm
- macos-13
- macos-14

Expand Down Expand Up @@ -55,6 +56,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 }}
Expand Down Expand Up @@ -119,8 +121,16 @@ 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
echo ccache=ccache >> $GITHUB_OUTPUT
else
echo ccache=sccache >> $GITHUB_OUTPUT
fi

# 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
Expand All @@ -146,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
;;
Expand Down Expand Up @@ -221,12 +231,14 @@ 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
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.
Expand All @@ -235,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: |
Expand Down
Loading