Skip to content

Commit 3f64959

Browse files
authored
CI: Enable more cross-compiled builds (#401)
* CI: Enable more aarch64 builds * Use cross for linux-aarch64-* builds * Use `macos-14` explicitly for now - https://github.com/orgs/community/discussions/116911 - https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/ * Add targets in release.yaml * Write changelog * Fix typo * Passthrough `BANDWHICH_GEN_DIR` into cross container * Add armv7 targets
1 parent d9fa089 commit 3f64959

File tree

4 files changed

+63
-13
lines changed

4 files changed

+63
-13
lines changed

.github/workflows/ci.yaml

+24-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ jobs:
5858
matrix:
5959
build:
6060
- android-aarch64
61+
- linux-aarch64-gnu
62+
- linux-aarch64-musl
63+
- linux-armv7-gnueabihf
64+
- linux-armv7-musleabihf
6165
- linux-x64-gnu
6266
- linux-x64-musl
67+
- macos-aarch64
6368
- macos-x64
6469
- windows-x64-msvc
6570
rust:
@@ -72,12 +77,29 @@ jobs:
7277
- build: android-aarch64
7378
target: aarch64-linux-android
7479
cargo: cross
80+
- build: linux-aarch64-gnu
81+
target: aarch64-unknown-linux-gnu
82+
cargo: cross
83+
- build: linux-aarch64-musl
84+
target: aarch64-unknown-linux-musl
85+
cargo: cross
86+
- build: linux-armv7-gnueabihf
87+
target: armv7-unknown-linux-gnueabihf
88+
cargo: cross
89+
- build: linux-armv7-musleabihf
90+
target: armv7-unknown-linux-musleabihf
91+
cargo: cross
7592
- build: linux-x64-gnu
7693
target: x86_64-unknown-linux-gnu
7794
- build: linux-x64-musl
7895
target: x86_64-unknown-linux-musl
96+
- build: macos-aarch64
97+
# Go back ot `macos-latest` after migration is complete
98+
# See https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/.
99+
os: macos-14
100+
target: aarch64-apple-darwin
79101
- build: macos-x64
80-
os: macos-latest
102+
os: macos-14
81103
target: x86_64-apple-darwin
82104
- build: windows-x64-msvc
83105
os: windows-latest
@@ -95,7 +117,7 @@ jobs:
95117

96118
- name: Install cross
97119
if: matrix.cargo == 'cross'
98-
# The latest realese of `cross` is not able to build/link for `aarch64-linux-android`
120+
# The latest release of `cross` is not able to build/link for `aarch64-linux-android`
99121
# See: https://github.com/cross-rs/cross/issues/1222
100122
# This is fixed on `main` but not yet released. To avoid a breakage somewhen in the future
101123
# pin the cross revision used to the latest HEAD at 04/2024.

.github/workflows/release.yaml

+36-11
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,45 @@ jobs:
5252
strategy:
5353
matrix:
5454
build:
55-
- aarch64-linux-android
55+
- android-aarch64
56+
- linux-aarch64-gnu
57+
- linux-aarch64-musl
58+
- linux-armv7-gnueabihf
59+
- linux-armv7-musleabihf
5660
- linux-x64-gnu
5761
- linux-x64-musl
62+
- macos-aarch64
5863
- macos-x64
5964
- windows-x64-msvc
6065
include:
66+
- os: ubuntu-latest # default
6167
- cargo: cargo # default; overwrite with `cross` if necessary
62-
- build: aarch64-linux-android
63-
os: ubuntu-latest
68+
- build: android-aarch64
6469
target: aarch64-linux-android
6570
cargo: cross
71+
- build: linux-aarch64-gnu
72+
target: aarch64-unknown-linux-gnu
73+
cargo: cross
74+
- build: linux-aarch64-musl
75+
target: aarch64-unknown-linux-musl
76+
cargo: cross
77+
- build: linux-armv7-gnueabihf
78+
target: armv7-unknown-linux-gnueabihf
79+
cargo: cross
80+
- build: linux-armv7-musleabihf
81+
target: armv7-unknown-linux-musleabihf
82+
cargo: cross
6683
- build: linux-x64-gnu
67-
os: ubuntu-latest
6884
target: x86_64-unknown-linux-gnu
6985
- build: linux-x64-musl
70-
os: ubuntu-latest
7186
target: x86_64-unknown-linux-musl
87+
- build: macos-aarch64
88+
# Go back ot `macos-latest` after migration is complete
89+
# See https://github.blog/changelog/2024-04-01-macos-14-sonoma-is-generally-available-and-the-latest-macos-runner-image/.
90+
os: macos-14
91+
target: aarch64-apple-darwin
7292
- build: macos-x64
73-
os: macos-latest
93+
os: macos-14
7494
target: x86_64-apple-darwin
7595
- build: windows-x64-msvc
7696
os: windows-latest
@@ -86,13 +106,18 @@ jobs:
86106
toolchain: stable
87107
targets: ${{ matrix.target }}
88108

89-
- name: Install musl-tools
90-
if: matrix.target == 'x86_64-unknown-linux-musl'
91-
run: sudo apt-get install -y --no-install-recommends musl-tools
92-
93109
- name: Install cross
94110
if: matrix.cargo == 'cross'
95-
run: cargo install --git https://github.com/cross-rs/cross.git --rev 085092c cross
111+
# The latest release of `cross` is not able to build/link for `aarch64-linux-android`
112+
# See: https://github.com/cross-rs/cross/issues/1222
113+
# This is fixed on `main` but not yet released. To avoid a breakage somewhen in the future
114+
# pin the cross revision used to the latest HEAD at 04/2024.
115+
# Go back to taiki-e/install-action once cross 0.3 is released.
116+
uses: taiki-e/cache-cargo-install-action@v1
117+
with:
118+
tool: cross
119+
git: https://github.com/cross-rs/cross.git
120+
rev: 085092c
96121

97122
- name: Build release binary
98123
shell: bash

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
2222
* Add PID column to the process table #379 - @notjedi
2323
* CI: add builds for target `aarch64-linux-android` #384 - @flxo
2424
* CI: Keep GitHub Actions up to date with GitHub's Dependabot #403 - @cclauss
25+
* CI: Enable more cross-compiled builds #401 - @cyqsimon
2526

2627
## Changed
2728

Cross.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build.env]
2+
passthrough = ["BANDWHICH_GEN_DIR"]

0 commit comments

Comments
 (0)