@@ -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
1815 - os : windows-latest
1916 target : x86_64-pc-windows-msvc
2017 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
18+ - os : ubuntu-latest
19+ target : x86_64-unknown-linux-gnu
20+ asset_name : linux-amd64
21+ - os : ubuntu-latest
22+ target : aarch64-unknown-linux-gnu
23+ asset_name : linux-arm64
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 :
@@ -499,32 +552,32 @@ jobs:
499552 [ "${{ runner.os }}" != "Windows" ] && chmod +x build_assets/*
500553 echo "Binaries prepared successfully"
501554
502- # - name: Create release if needed
503- # shell: bash
504- # env:
505- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
506- # run: |
507- # TAG="${{ steps.get_commit.outputs.short_commit }}"
508- # if ! gh release view "$TAG" &>/dev/null; then
509- # gh release create "$TAG" \
510- # --title "Release $TAG" \
511- # --notes "Release for slipstream-rust commit $TAG
512-
513- # This release contains prebuilt binaries for:
514- # - Linux (x86_64)
515- # - Windows (x86_64)
516- # - macOS (ARM64)
517- # - macOS (Intel x86_64)"
518- # fi
519-
520- # - name: Upload binaries to release
521- # uses: svenstaro/upload-release-action@v2
522- # with:
523- # repo_token: ${{ secrets.GITHUB_TOKEN }}
524- # file: build_assets/slipstream-*
525- # file_glob: true
526- # tag: ${{ steps.get_commit.outputs.short_commit }}
527- # overwrite: true
555+ - name : Create release if needed
556+ shell : bash
557+ env :
558+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
559+ run : |
560+ TAG="${{ steps.get_commit.outputs.short_commit }}"
561+ if ! gh release view "$TAG" &>/dev/null; then
562+ gh release create "$TAG" \
563+ --title "Release $TAG" \
564+ --notes "Release for slipstream-rust commit $TAG
565+
566+ This release contains prebuilt binaries for:
567+ - Linux (x86_64)
568+ - Windows (x86_64)
569+ - macOS (ARM64)
570+ - macOS (Intel x86_64)"
571+ fi
572+
573+ - name : Upload binaries to release
574+ uses : svenstaro/upload-release-action@v2
575+ with :
576+ repo_token : ${{ secrets.GITHUB_TOKEN }}
577+ file : build_assets/slipstream-*
578+ file_glob : true
579+ tag : ${{ steps.get_commit.outputs.short_commit }}
580+ overwrite : true
528581
529582 - name : Upload artifacts
530583 uses : actions/upload-artifact@v4
0 commit comments