Skip to content

Commit dec60e2

Browse files
committed
Build armhf binaries inside a container
1 parent f938641 commit dec60e2

2 files changed

Lines changed: 17 additions & 17 deletions

File tree

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ dist = "run --package xtask --bin xtask -- dist"
99
[target.x86_64-pc-windows-msvc]
1010
linker = "rust-lld"
1111

12+
[target.arm-unknown-linux-gnueabihf]
13+
linker = "arm-linux-gnueabihf-gcc-8"
14+
1215
[env]
1316
CARGO_WORKSPACE_DIR = { value = "", relative = true }

.github/workflows/release.yaml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ env:
1717
RUSTUP_MAX_RETRIES: 10
1818
FETCH_DEPTH: 0 # pull in the tags for the version string
1919
MACOSX_DEPLOYMENT_TARGET: 14.0
20-
ZIG_VERSION: 0.13.0
21-
ZIGBUILD_VERSION: 0.19.8
2220

2321
jobs:
2422
dist:
@@ -55,7 +53,9 @@ jobs:
5553
pgo: clap-rs/clap@v4.5.36
5654
- os: ubuntu-latest
5755
target: arm-unknown-linux-gnueabihf
58-
zig_target: arm-unknown-linux-gnueabihf.2.28
56+
# Use a Debian 10 (EOL) container for glibc 2.28
57+
# pypa/manylinux only has armv7l and glibc 2.31
58+
container: debian:10
5959
code-target: linux-armhf
6060
allocator: system
6161
- os: macos-14
@@ -83,6 +83,16 @@ jobs:
8383
with:
8484
fetch-depth: ${{ env.FETCH_DEPTH }}
8585

86+
- name: Install target dependencies
87+
if: ${{ matrix.target == 'arm-unknown-linux-gnueabihf' }}
88+
run: |
89+
sed -i 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list
90+
sed -i 's/security.debian.org/archive.debian.org/g' /etc/apt/sources.list
91+
sed -i '/buster-updates/d' /etc/apt/sources.list
92+
apt-get update
93+
apt-get dist-upgrade -y
94+
apt-get install -y curl gcc gcc-8-arm-linux-gnueabihf
95+
8696
- name: Install Node.js toolchain
8797
uses: actions/setup-node@v6
8898
with:
@@ -101,22 +111,9 @@ jobs:
101111
rustup component add rust-src ${{ matrix.pgo && 'llvm-tools' || '' }}
102112
rustup target add ${{ matrix.target }}
103113
104-
- name: Install Zig toolchain
105-
if: ${{ matrix.zig_target }}
106-
run: |
107-
which cargo
108-
curl -L "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz" | sudo tar JxC /usr/local
109-
sudo ln -s "/usr/local/zig-linux-$(uname -m)-${ZIG_VERSION}/zig" /usr/local/bin/zig
110-
curl -L "https://github.com/rust-cross/cargo-zigbuild/releases/download/v${ZIGBUILD_VERSION}/cargo-zigbuild-v${ZIGBUILD_VERSION}.x86_64-unknown-linux-musl.tar.gz" | tar zxC ~/.cargo/bin
111-
112-
- name: Dist (plain)
113-
if: ${{ !matrix.zig_target }}
114+
- name: Dist
114115
run: cargo xtask dist --client-patch-version ${{ github.run_number }} ${{ env.ALLOCATOR_FLAG }} ${{ matrix.pgo && format('--pgo {0}', matrix.pgo) || ''}}
115116

116-
- name: Dist (using zigbuild)
117-
if: ${{ matrix.zig_target }}
118-
run: RA_TARGET=${{ matrix.zig_target}} cargo xtask dist --client-patch-version ${{ github.run_number }} --zig ${{ env.ALLOCATOR_FLAG }} ${{ matrix.pgo && format('--pgo {0}', matrix.pgo) || ''}}
119-
120117
- run: npm ci
121118
working-directory: editors/code
122119

0 commit comments

Comments
 (0)