@@ -111,19 +111,25 @@ jobs:
111
111
variant : sccache
112
112
113
113
- name : Build Stage 1 Clang
114
+ id : build
114
115
shell : bash
115
116
run : |
116
- sudo chown $USER:$USER /mnt/
117
- cmake -G Ninja -C clang/cmake/caches/Release.cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -S llvm -B /mnt/build
118
- ninja -v -C /mnt/build
117
+ build_prefix=`pwd`
118
+ if [ "${{ runner.os }}" = "Linux" ]; then
119
+ sudo chown $USER:$USER /mnt/
120
+ build_prefix=/mnt/
121
+ fi
122
+ cmake -G Ninja -C clang/cmake/caches/Release.cmake -DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache -S llvm -B $build_prefix/build
123
+ ninja -v -C $build_prefix/build
124
+ echo "build-prefix=$build_prefix" >> $GITHUB_OUTPUT
119
125
120
126
# We need to create an archive of the build directory, because it has too
121
127
# many files to upload.
122
128
- name : Package Build and Source Directories
123
129
shell : bash
124
130
run : |
125
131
tar -c . | zstd -T0 -c > llvm-project.tar.zst
126
- tar -C /mnt/ -c build/ | zstd -T0 -c > build.tar.zst
132
+ tar ${{ steps.build.outputs.build_prefix }} -c build/ | zstd -T0 -c > build.tar.zst
127
133
128
134
- name : Upload Stage 1 Source
129
135
uses : actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
@@ -165,26 +171,32 @@ jobs:
165
171
166
172
- name : Unpack Artifacts
167
173
shell : bash
174
+ id : unpack
168
175
run : |
176
+ build_prefix=`pwd`
177
+ if [ "${{ runner.os }}" = "Linux" ]; then
178
+ sudo chown $USER:$USER /mnt/
179
+ build_prefix=/mnt/
180
+ fi
169
181
tar --zstd -xf llvm-project.tar.zst
170
182
rm llvm-project.tar.zst
171
- sudo chown $USER:$USER /mnt/
172
- tar --zstd -C /mnt -xf build.tar.zst
183
+ tar --zstd -C $build_prefix -xf build.tar.zst
173
184
rm build.tar.zst
185
+ echo "build-prefix=$build_prefix" >> $GITHUB_OUTPUT
174
186
175
187
- name : Build Stage 2
176
188
if : false
177
189
shell : bash
178
190
run : |
179
- ninja -C /mnt /build stage2-instrumented
191
+ ninja -C ${{ steps.unpack.outputs.build-prefix}} /build stage2-instrumented
180
192
181
193
# We need to create an archive of the build directory, because it has too
182
194
# many files to upload.
183
195
- name : Save Build and Source Directories
184
196
shell : bash
185
197
run : |
186
198
tar -c . | zstd -T0 -c > llvm-project.tar.zst
187
- tar -C /mnt/ -c build/ | zstd -T0 -c > build.tar.zst
199
+ tar -C ${{ steps.unpack.outputs.build-prefix }} -c build/ | zstd -T0 -c > build.tar.zst
188
200
189
201
- name : Upload Stage 2 Source
190
202
uses : actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
@@ -229,12 +241,18 @@ jobs:
229
241
230
242
- name : Unpack Artifact
231
243
shell : bash
244
+ id : unpack
232
245
run : |
246
+ build_prefix=`pwd`
247
+ if [ "${{ runner.os }}" = "Linux" ]; then
248
+ sudo chown $USER:$USER /mnt/
249
+ build_prefix=/mnt/
250
+ fi
233
251
tar --zstd -xf llvm-project.tar.zst
234
252
rm llvm-project.tar.zst
235
- sudo chown $USER:$USER /mnt/
236
- tar --zstd -C /mnt -xf build.tar.zst
253
+ tar --zstd -C $build_prefix -xf build.tar.zst
237
254
rm build.tar.zst
255
+ echo "build-prefix=$build_prefix" >> $GITHUB_OUTPUT
238
256
239
257
- name : Timeout Restore
240
258
id : timeout
@@ -245,7 +263,7 @@ jobs:
245
263
- name : Build Release Package
246
264
shell : bash
247
265
run : |
248
- ninja -C /mnt /build stage2-package
266
+ ninja -C ${{ steps.unpack.outputs.build-preifx }} /build stage2-package
249
267
250
268
- name : Timeout Save
251
269
if : always()
@@ -261,7 +279,7 @@ jobs:
261
279
run : |
262
280
filename="LLVM-${{ needs.prepare.outputs.release-version }}-Linux.tar.gz"
263
281
echo "filename=$filename" >> $GITHUB_OUTPUT
264
- echo "path=/mnt /build/tools/clang/stage2-bins/$filename" >> $GITHUB_OUTPUT
282
+ echo "path=${{ steps.unpack.outputs.build-prefix }} /build/tools/clang/stage2-bins/$filename" >> $GITHUB_OUTPUT
265
283
266
284
- uses : actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
267
285
if : always()
@@ -273,15 +291,15 @@ jobs:
273
291
- name : Clean Up Build Directory
274
292
shell : bash
275
293
run : |
276
- find /mnt /build -iname ${{ steps.package-info.outputs.filename }} -delete
294
+ find ${{ steps.unpack.outputs.build-prefix }} /build -iname ${{ steps.package-info.outputs.filename }} -delete
277
295
278
296
# We need to create an archive of the build directory, because it has too
279
297
# many files to upload.
280
298
- name : Save Build and Source Directories
281
299
shell : bash
282
300
run : |
283
301
tar -c . | zstd -T0 -c > llvm-project.tar.zst
284
- tar -C /mnt/ -c build/ | zstd -T0 -c > build.tar.zst
302
+ tar -C ${{ steps.unpack.outputs.build-prefix }} -c build/ | zstd -T0 -c > build.tar.zst
285
303
286
304
- name : Upload Stage 3 Source
287
305
uses : actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
@@ -350,14 +368,20 @@ jobs:
350
368
351
369
- name : Unpack Artifact
352
370
shell : bash
371
+ id : unpack
353
372
run : |
373
+ build_prefix=`pwd`
374
+ if [ "${{ runner.os }}" = "Linux" ]; then
375
+ sudo chown $USER:$USER /mnt/
376
+ build_prefix=/mnt/
377
+ fi
354
378
tar --zstd -xf llvm-project.tar.zst
355
379
rm llvm-project.tar.zst
356
- sudo chown $USER:$USER /mnt/
357
- tar --zstd -C /mnt -xf build.tar.zst
380
+ tar --zstd -C $build_prefix -xf build.tar.zst
358
381
rm build.tar.zst
382
+ echo "build-prefix=$build_prefix" >> $GITHUB_OUTPUT
359
383
360
384
- name : Run Tests
361
385
shell : bash
362
386
run : |
363
- ninja -C /mnt /build stage2-check-all
387
+ ninja -C ${{ steps.unpack.outputs.build-prefix }} /build stage2-check-all
0 commit comments