@@ -12,18 +12,21 @@ jobs:
1212 strategy :
1313 matrix :
1414 include :
15- # - os: ubuntu-latest
16- # target: x86_64-unknown-linux-gnu
17- # asset_name: linux-amd64
18- - os : windows-latest
19- target : x86_64-pc-windows-msvc
20- asset_name : windows-amd64
21- # - os: macos-latest
22- # target: aarch64-apple-darwin
23- # asset_name: darwin-arm64
24- # - os: macos-latest
25- # target: x86_64-apple-darwin
26- # asset_name: darwin-amd64
15+ - os : ubuntu-latest
16+ target : aarch64-unknown-linux-gnu
17+ asset_name : linux-arm64
18+ # - os: windows-latest
19+ # target: x86_64-pc-windows-msvc
20+ # asset_name: windows-amd64
21+ # - os: ubuntu-latest
22+ # target: x86_64-unknown-linux-gnu
23+ # asset_name: linux-amd64
24+ # - os: macos-latest
25+ # target: aarch64-apple-darwin
26+ # asset_name: darwin-arm64
27+ # - os: macos-latest
28+ # target: x86_64-apple-darwin
29+ # asset_name: darwin-amd64
2730 fail-fast : false
2831
2932 runs-on : ${{ matrix.os }}
@@ -44,12 +47,24 @@ jobs:
4447 submodules : recursive
4548 path : slipstream-rust
4649
50+ - name : Set up QEMU
51+ if : runner.os == 'Linux' && matrix.target == 'aarch64-unknown-linux-gnu'
52+ uses : docker/setup-qemu-action@v3
53+
54+ - name : Set up Docker Buildx
55+ if : runner.os == 'Linux' && matrix.target == 'aarch64-unknown-linux-gnu'
56+ uses : docker/setup-buildx-action@v3
57+ with :
58+ platforms : linux/arm64,linux/amd64
59+
4760 - name : Install Rust
61+ if : runner.os != 'Linux' || matrix.target != 'aarch64-unknown-linux-gnu'
4862 uses : dtolnay/rust-toolchain@stable
4963 with :
5064 targets : ${{ matrix.target }}
5165
5266 - name : Install cross toolchain
67+ if : runner.os != 'Linux' || matrix.target != 'aarch64-unknown-linux-gnu'
5368 uses : taiki-e/setup-cross-toolchain-action@v1
5469 with :
5570 target : ${{ env.TARGET }}
6378 echo "short_commit=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT
6479
6580 - name : Cache Rust dependencies
81+ if : runner.os != 'Linux' || matrix.target != 'aarch64-unknown-linux-gnu'
6682 uses : actions/cache@v4
6783 with :
6884 path : |
@@ -77,10 +93,13 @@ jobs:
7793 ${{ runner.os }}-rust-
7894
7995 - name : Install build dependencies (Linux)
80- if : runner.os == 'Linux'
96+ if : runner.os == 'Linux' && matrix.target != 'aarch64-unknown-linux-gnu'
8197 run : |
8298 sudo apt-get update
83- sudo apt-get install -y cmake pkg-config libssl-dev gcc g++ perl
99+ sudo apt-get install -y cmake pkg-config gcc g++ perl
100+ if [[ "${{ matrix.target }}" == "x86_64-unknown-linux-gnu" ]]; then
101+ sudo apt-get install -y libssl-dev
102+ fi
84103
85104 - name : Install build dependencies (macOS)
86105 if : runner.os == 'macOS'
@@ -167,8 +186,41 @@ jobs:
167186 echo "OPENSSL_ROOT_DIR=/opt/homebrew/opt/openssl@3" >> $GITHUB_ENV
168187 fi
169188
189+ - name : Build with Docker buildx (Linux ARM64)
190+ if : runner.os == 'Linux' && matrix.target == 'aarch64-unknown-linux-gnu'
191+ run : |
192+ # Create a temporary directory for the build output
193+ mkdir -p docker-build-output
194+
195+ mkdir -p slipstream-rust/target/aarch64-unknown-linux-gnu/release
196+
197+ # Build the image for linux/arm64 and load it using a pipe
198+ # This works around the --load limitation with cross-platform builds
199+ docker buildx build \
200+ --platform linux/arm64 \
201+ --file Dockerfile.arm64 \
202+ --tag slipstream-build:arm64 \
203+ --output type=docker,dest=- \
204+ . | docker load
205+
206+ # Run the container with --platform flag to use QEMU emulation
207+ # Mount slipstream-rust as read-write so build artifacts can be written
208+ docker run --rm \
209+ --platform linux/arm64 \
210+ -v "${{ github.workspace }}/slipstream-rust:/workspace/slipstream-rust" \
211+ -v "${{ github.workspace }}/docker-build-output:/workspace/output" \
212+ slipstream-build:arm64
213+
214+ sudo chown -R $(id -u):$(id -g) slipstream-rust/target/ 2>/dev/null || true
215+
216+ cp docker-build-output/slipstream-client slipstream-rust/target/aarch64-unknown-linux-gnu/release/
217+ cp docker-build-output/slipstream-server slipstream-rust/target/aarch64-unknown-linux-gnu/release/
218+
219+ # Verify binaries exist
220+ ls -lh slipstream-rust/target/aarch64-unknown-linux-gnu/release/
221+
170222 - name : Build picoquic (Linux)
171- if : runner.os == 'Linux'
223+ if : runner.os == 'Linux' && matrix.target != 'aarch64-unknown-linux-gnu'
172224 working-directory : slipstream-rust
173225 run : |
174226 bash scripts/build_picoquic.sh
@@ -418,6 +470,7 @@ jobs:
418470 fi
419471
420472 - name : Build slipstream binaries
473+ if : runner.os != 'Linux' || matrix.target != 'aarch64-unknown-linux-gnu'
421474 working-directory : slipstream-rust
422475 shell : bash
423476 env :
0 commit comments