Skip to content

Commit 7572bd1

Browse files
committed
feat(release): build static Linux x64 binaries with musl
Switch Linux x64 release builds from dynamic glibc (x86_64-unknown-linux-gnu) to static musl (x86_64-unknown-linux-musl) in GitHub Actions release workflow. - Change matrix target for codewhale and codewhale-tui linux-x64 to musl - Add dedicated musl build step: install musl-tools, add musl target - Skip libdbus-1-dev install for musl targets (keyring gated at compile time) - Skip generic Build step for musl (handled by dedicated step) - Parity with CNB pipeline (.cnb.yml) which already uses musl (PR #2903) Static binaries have no glibc/libdbus runtime dependency and run on any Linux distribution without additional packages.
1 parent 14ac031 commit 7572bd1

1 file changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
components: clippy, rustfmt
2929
- name: Install Linux system dependencies
30-
if: runner.os == 'Linux'
30+
if: runner.os == 'Linux' && matrix.target != 'x86_64-unknown-linux-musl'
3131
run: |
3232
for i in 1 2 3 4 5; do
3333
sudo apt-get update && break
@@ -111,7 +111,7 @@ jobs:
111111
include:
112112
# --- codewhale (cli dispatcher, canonical) ---
113113
- os: ubuntu-latest
114-
target: x86_64-unknown-linux-gnu
114+
target: x86_64-unknown-linux-musl
115115
binary: codewhale
116116
artifact_name: codewhale-linux-x64
117117
- os: ubuntu-latest
@@ -136,7 +136,7 @@ jobs:
136136
artifact_name: codewhale-windows-x64.exe
137137
# --- codewhale-tui (TUI runtime, canonical) ---
138138
- os: ubuntu-latest
139-
target: x86_64-unknown-linux-gnu
139+
target: x86_64-unknown-linux-musl
140140
binary: codewhale-tui
141141
artifact_name: codewhale-tui-linux-x64
142142
- os: ubuntu-latest
@@ -171,14 +171,21 @@ jobs:
171171
with:
172172
cache-bin: false
173173
- name: Install Linux system dependencies
174-
if: runner.os == 'Linux'
174+
if: runner.os == 'Linux' && matrix.target != 'x86_64-unknown-linux-musl'
175175
run: |
176176
for i in 1 2 3 4 5; do
177177
sudo apt-get update && break
178178
echo "apt-get update failed (attempt $i); retrying in 15s"
179179
sleep 15
180180
done
181181
sudo apt-get install -y libdbus-1-dev pkg-config
182+
- name: Build static Linux x64 binary (musl)
183+
if: matrix.target == 'x86_64-unknown-linux-musl'
184+
shell: bash
185+
run: |
186+
sudo apt-get install -y musl-tools
187+
rustup target add x86_64-unknown-linux-musl
188+
cargo build --release --locked --target x86_64-unknown-linux-musl
182189
- name: Install RISC-V cross-compilation toolchain
183190
if: matrix.target == 'riscv64gc-unknown-linux-gnu'
184191
run: |
@@ -215,6 +222,7 @@ jobs:
215222
sudo apt-get update -o Dir::Etc::sourcelist=/etc/apt/sources.list.d/arm64.sources -o Dir::Etc::sourceparts=- -o APT::Get::List-Cleanup=0
216223
sudo apt-get install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross libdbus-1-dev:arm64 pkg-config
217224
- name: Build
225+
if: matrix.target != 'x86_64-unknown-linux-musl'
218226
shell: bash
219227
env:
220228
DEEPSEEK_BUILD_SHA: ${{ needs.resolve.outputs.sha }}

0 commit comments

Comments
 (0)