Skip to content

Commit fb5c079

Browse files
committed
github: Build linux-stage1 and linux in parallel on aarch64 and x86_64
This makes the linux aarch64 package natively built on aarch64, rather than cross compiled from x86_64. The linux aarch64 runners currently seem to be faster than the x86_64 ones - but this change doesn't affect the total pipeline runtime as the matrices wait for all jobs in them to complete before proceeding.
1 parent 5cb8309 commit fb5c079

File tree

1 file changed

+18
-58
lines changed

1 file changed

+18
-58
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ jobs:
6666

6767
linux-stage1:
6868
needs: [prepare]
69-
runs-on: ubuntu-22.04
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
include:
73+
- { runner: ubuntu-22.04, arch: x86_64 }
74+
- { runner: ubuntu-22.04-arm, arch: aarch64 }
75+
runs-on: ${{matrix.runner}}
7076
steps:
7177
- uses: actions/checkout@v4
7278
- name: Build
@@ -91,7 +97,7 @@ jobs:
9197
tar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 --sort=name --mtime="$BUILD_DATE" $NAME
9298
- uses: actions/upload-artifact@v4
9399
with:
94-
name: linux-stage1-ucrt-x86_64-toolchain
100+
name: linux-stage1-ucrt-${{matrix.arch}}-toolchain
95101
path: |
96102
llvm-mingw-*.tar.xz
97103
retention-days: 7
@@ -129,12 +135,18 @@ jobs:
129135
# Build a cross compiler for Linux, targeting Windows.
130136
linux:
131137
needs: [prepare, linux-stage1, linux-profile]
132-
runs-on: ubuntu-22.04
138+
strategy:
139+
fail-fast: false
140+
matrix:
141+
include:
142+
- { runner: ubuntu-22.04, arch: x86_64 }
143+
- { runner: ubuntu-22.04-arm, arch: aarch64 }
144+
runs-on: ${{matrix.runner}}
133145
steps:
134146
- uses: actions/checkout@v4
135147
- uses: actions/download-artifact@v4
136148
with:
137-
name: linux-stage1-ucrt-x86_64-toolchain
149+
name: linux-stage1-ucrt-${{matrix.arch}}-toolchain
138150
- name: Unpack stage1 Clang
139151
run: |
140152
tar -Jxf llvm-mingw-*.tar.xz
@@ -164,59 +176,7 @@ jobs:
164176
tar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 --sort=name --mtime="$BUILD_DATE" $NAME
165177
- uses: actions/upload-artifact@v4
166178
with:
167-
name: linux-ucrt-x86_64-toolchain
168-
path: |
169-
llvm-mingw-*.tar.xz
170-
retention-days: 7
171-
172-
# Crosscompile the toolchain for running on Linux on a different architecture, bundle the runtime
173-
# libraries that were built in the 'linux-stage1' step above.
174-
linux-cross-aarch64:
175-
needs: [linux-stage1, linux-profile, prepare]
176-
runs-on: ubuntu-22.04
177-
steps:
178-
- uses: actions/checkout@v4
179-
- uses: actions/download-artifact@v4
180-
with:
181-
name: linux-stage1-ucrt-x86_64-toolchain
182-
- name: Unpack stage1 Clang
183-
run: |
184-
tar -Jxf llvm-mingw-*.tar.xz
185-
rm llvm-mingw-*.tar.xz
186-
sudo mv llvm-mingw* /opt/llvm-mingw
187-
- uses: actions/download-artifact@v4
188-
with:
189-
name: profile
190-
- name: Build
191-
env:
192-
LLVM_VERSION: ${{needs.prepare.outputs.LLVM_VERSION}}
193-
MINGW_W64_VERSION: ${{needs.prepare.outputs.MINGW_W64_VERSION}}
194-
SOURCE_DATE_EPOCH: ${{needs.prepare.outputs.COMMIT_DATE_UNIX}}
195-
run: |
196-
sudo apt-get update && sudo apt-get install g++-aarch64-linux-gnu
197-
./build-all.sh /opt/llvm-mingw $(pwd)/install/llvm-mingw --no-runtimes --host=aarch64-linux-gnu --thinlto --pgo
198-
.github/workflows/store-version.sh install/llvm-mingw/versions.txt
199-
- name: Assemble the cross-built toolchain
200-
run: |
201-
./prepare-cross-toolchain-unix.sh /opt/llvm-mingw $(pwd)/install/llvm-mingw
202-
- name: Test using the cross-built assembled toolchain
203-
run: |
204-
sudo apt-get update && sudo apt-get install qemu-user-static libc6-arm64-cross libstdc++6-arm64-cross
205-
QEMU_LD_PREFIX=/usr/aarch64-linux-gnu ./test-libcxx-module.sh $(pwd)/install/llvm-mingw
206-
QEMU_LD_PREFIX=/usr/aarch64-linux-gnu ./run-tests.sh $(pwd)/install/llvm-mingw
207-
- name: Package the toolchain
208-
env:
209-
TAG: ${{needs.prepare.outputs.TAG}}
210-
BUILD_DATE: ${{needs.prepare.outputs.BUILD_DATE}}
211-
run: |
212-
cd install
213-
DISTRO=ubuntu-$(grep DISTRIB_RELEASE /etc/lsb-release | cut -f 2 -d =)-aarch64
214-
NAME=llvm-mingw-$TAG-ucrt-$DISTRO
215-
mv llvm-mingw $NAME
216-
tar -Jcf ../$NAME.tar.xz --format=ustar --numeric-owner --owner=0 --group=0 --sort=name --mtime="$BUILD_DATE" $NAME
217-
- uses: actions/upload-artifact@v4
218-
with:
219-
name: linux-ucrt-aarch64-toolchain
179+
name: linux-ucrt-${{matrix.arch}}-toolchain
220180
path: |
221181
llvm-mingw-*.tar.xz
222182
retention-days: 7
@@ -787,7 +747,7 @@ jobs:
787747
if: github.event_name == 'schedule'
788748
permissions:
789749
contents: write
790-
needs: [linux, linux-cross-aarch64, macos, linux-cross-windows, test-toolchain, linux-test-cross-build-ffmpeg, test-ffmpeg]
750+
needs: [linux, macos, linux-cross-windows, test-toolchain, linux-test-cross-build-ffmpeg, test-ffmpeg]
791751
runs-on: ubuntu-latest
792752
steps:
793753
- name: Download all artifacts

0 commit comments

Comments
 (0)