Use Zig for release cross builds - #109
Open
scaryrawr wants to merge 1 commit into
Open
Conversation
Consolidate release compilation into a Linux-hosted cross-build matrix, using Zig-backed Cargo linking for Linux targets and cargo-zigbuild for Windows targets. Update packaging paths and documentation for the new release flow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the release build pipeline to use Zig as the cross-linker/toolchain driver so Linux-hosted CI can produce Linux and Windows CLI release artifacts with fewer platform-specific workflows.
Changes:
- Adds Zig-based linker wrapper scripts plus a checked-in
.cargo/config.tomlto drive Linux GNU cross-target linking via Zig. - Consolidates release builds into a single Ubuntu-hosted cross-build matrix (Linux
.deb+ Windows NSIS installers) and removes the old Ubuntu/Windows reusable workflows andwin-build.ps1. - Updates Windows installer discovery and naming in
CMakeLists.txt, and documents the new Zig-based flow in READMEs and Copilot guidance.
Show a summary per file
| File | Description |
|---|---|
win-build.ps1 |
Removes obsolete Windows build helper script. |
scripts/zig-cc-x86_64-unknown-linux-gnu.sh |
Adds Zig linker wrapper for x86_64-unknown-linux-gnu. |
scripts/zig-cc-aarch64-unknown-linux-gnu.sh |
Adds Zig linker wrapper for aarch64-unknown-linux-gnu. |
scripts/zig-cc-linker.sh |
Centralizes target-to-Zig-target mapping and dispatches to zig cc. |
README.md |
Documents Zig-based cross-compilation approach. |
README.ja.md |
Japanese documentation for Zig-based cross-compilation. |
CMakeLists.txt |
Adjusts installer artifact lookup and output naming for the new cross-build outputs. |
.github/workflows/win-build.yml |
Removes old Windows-hosted reusable workflow. |
.github/workflows/ubuntu-build.yml |
Removes old Ubuntu reusable workflow with GCC-based cross compilation. |
.github/workflows/posix-build.yml |
Removes old POSIX reusable workflow. |
.github/workflows/build.yml |
Adds Ubuntu-hosted cross-build matrix + macOS smoke job; updates release dependencies. |
.github/copilot-instructions.md |
Updates build-tool and CI guidance to reflect Zig/cargo-zigbuild usage. |
.cargo/config.toml |
Adds target-specific linker configuration pointing to Zig wrapper scripts. |
Copilot's findings
- Files reviewed: 13/13 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release builds currently depend on several host-specific CI paths, including Linux cross GCC and Windows MSVC-hosted compilation. This consolidates the release CLI builds around Zig so Linux-hosted CI can produce the cross-platform artifacts with fewer target-specific pipelines.
Summary
cargo-zigbuildfor Windowsx86_64-pc-windows-gnuandaarch64-pc-windows-gnullvmbuilds instead of MSVC-hosted compilation.win-build.ps1, and document the new flow in README and Copilot guidance.Validation
cargo testcargo build --manifest-path=apps/sl/Cargo.toml --release --target x86_64-unknown-linux-gnucargo build --manifest-path=apps/sl/Cargo.toml --release --target aarch64-unknown-linux-gnucargo zigbuild --manifest-path=apps/sl/Cargo.toml --target x86_64-pc-windows-gnucargo zigbuild --manifest-path=apps/sl/Cargo.toml --target aarch64-pc-windows-gnullvm