Skip to content

Commit 0a28c07

Browse files
authored
workflows/release-binaries: Disable LTO/PGO for testing macOS job in PRs (#165801)
When a PR is submitted the macos-14 workflow will run with LTO/PGO disabled. This makes it possible to run the workflow on the free runners with the six hour timeout and will allow us to test the workflow on pull requests.
1 parent 8fd1bf2 commit 0a28c07

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/release-binaries.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ jobs:
138138
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF"
139139
fi
140140
141-
echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
142141
case "${{ inputs.runs-on }}" in
143142
ubuntu-22.04*)
144143
build_runs_on="depot-${{ inputs.runs-on }}-16"
@@ -157,6 +156,23 @@ jobs:
157156
build_runs_on=$test_runs_on
158157
;;
159158
esac
159+
160+
case "$build_runs_on" in
161+
# These runners cannot build the full release package faster than
162+
# the 6 hours timeout limit, so we need to use a configuration
163+
# that builds more quickly.
164+
macos-14)
165+
bootstrap_prefix="BOOTSTRAP"
166+
target_cmake_flags="$target_cmake_flags -DLLVM_RELEASE_ENABLE_LTO=OFF -DLLVM_RELEASE_ENABLE_PGO=OFF"
167+
;;
168+
*)
169+
bootstrap_prefix="BOOTSTRAP_BOOTSTRAP"
170+
;;
171+
esac
172+
173+
target_cmake_flags="$target_cmake_flags -D${bootstrap_prefix}_CPACK_PACKAGE_FILE_NAME=$release_binary_basename"
174+
175+
echo "target-cmake-flags=$target_cmake_flags" >> $GITHUB_OUTPUT
160176
echo "build-runs-on=$build_runs_on" >> $GITHUB_OUTPUT
161177
echo "test-runs-on=$test_runs_on" >> $GITHUB_OUTPUT
162178
@@ -200,8 +216,7 @@ jobs:
200216
# so we need to set some extra cmake flags to disable this.
201217
cmake -G Ninja -S llvm -B ${{ steps.setup-stage.outputs.build-prefix }}/build \
202218
${{ needs.prepare.outputs.target-cmake-flags }} \
203-
-C clang/cmake/caches/Release.cmake \
204-
-DBOOTSTRAP_BOOTSTRAP_CPACK_PACKAGE_FILE_NAME="${{ needs.prepare.outputs.release-binary-basename }}"
219+
-C clang/cmake/caches/Release.cmake
205220
206221
- name: Build
207222
shell: bash

0 commit comments

Comments
 (0)