Skip to content

Commit 21af3b6

Browse files
tstellartru
authored andcommitted
workflows/release-binaries: Do a preliminary build to fill ccache (llvm#72576)
Build clang with the host compiler and ccache enabled in order to speed up the phase 1 builds. This helps reduce the amount of time spent running on the non-free builders. (cherry picked from commit e746b56)
1 parent 201faec commit 21af3b6

File tree

1 file changed

+46
-2
lines changed

1 file changed

+46
-2
lines changed

.github/workflows/release-binaries.yml

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,52 @@ jobs:
5757
fi
5858
bash .github/workflows/set-release-binary-outputs.sh "${{ github.actor }}" "$tag" "$upload"
5959
60+
# Try to get around the 6 hour timeout by first running a job to fill
61+
# the build cache.
62+
fill-cache:
63+
name: "Fill Cache ${{ matrix.os }}"
64+
needs: prepare
65+
runs-on: ${{ matrix.os }}
66+
strategy:
67+
matrix:
68+
os:
69+
- ubuntu-22.04
70+
steps:
71+
- name: Checkout LLVM
72+
uses: actions/checkout@v4
73+
with:
74+
ref: ${{ inputs.tag || github.ref_name }}
75+
76+
- name: Install Ninja
77+
uses: llvm/actions/install-ninja@main
78+
79+
- name: Setup sccache
80+
uses: hendrikmuhs/ccache-action@v1
81+
with:
82+
max-size: 250M
83+
key: sccache-${{ matrix.os }}-release
84+
variant: sccache
85+
86+
- name: Build Clang
87+
run: |
88+
cmake -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -DCMAKE_BUILD_TYPE=Release -DCMAKE_ENABLE_ASSERTIONS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DLLVM_ENABLE_PROJECTS=clang -S llvm -B build
89+
ninja -v -C build
90+
91+
6092
build-binaries:
6193
name: ${{ matrix.target.triple }}
6294
permissions:
6395
contents: write # To upload assets to release.
64-
needs: prepare
96+
needs:
97+
- prepare
98+
- fill-cache
6599
runs-on: ${{ matrix.target.runs-on }}
66100
strategy:
67101
fail-fast: false
68102
matrix:
69103
target:
70104
- triple: x86_64-linux-gnu-ubuntu-22.04
105+
os: ubuntu-22.04
71106
runs-on: ubuntu-22.04-16x64
72107
debian-build-deps: >
73108
chrpath
@@ -81,6 +116,14 @@ jobs:
81116
ref: ${{ needs.prepare.outputs.ref }}
82117
path: ${{ needs.prepare.outputs.build-dir }}/llvm-project
83118

119+
- name: Setup sccache
120+
uses: hendrikmuhs/ccache-action@v1
121+
with:
122+
max-size: 250M
123+
key: sccache-${{ matrix.target.os }}-release
124+
save: false
125+
variant: sccache
126+
84127
- name: Install Brew build dependencies
85128
if: matrix.target.brew-build-deps != ''
86129
run: brew install ${{ matrix.target.brew-build-deps }}
@@ -102,7 +145,8 @@ jobs:
102145
-triple ${{ matrix.target.triple }} \
103146
-use-ninja \
104147
-no-checkout \
105-
-no-test-suite
148+
-no-test-suite \
149+
-configure-flags "-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache"
106150
107151
- name: Upload binaries
108152
if: ${{ always() && needs.prepare.outputs.upload == 'true' }}

0 commit comments

Comments
 (0)