Skip to content

Use Zig for release cross builds - #109

Open
scaryrawr wants to merge 1 commit into
mainfrom
scaryrawr-zig-rust-toolchain
Open

Use Zig for release cross builds#109
scaryrawr wants to merge 1 commit into
mainfrom
scaryrawr-zig-rust-toolchain

Conversation

@scaryrawr

Copy link
Copy Markdown
Owner

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

  • Add checked-in Cargo linker config and Zig wrapper scripts for Linux GNU cross targets.
  • Consolidate release compilation into a single Linux-hosted matrix for Linux and Windows CLI targets.
  • Use cargo-zigbuild for Windows x86_64-pc-windows-gnu and aarch64-pc-windows-gnullvm builds instead of MSVC-hosted compilation.
  • Update CPack installer lookup/output naming, remove obsolete reusable workflows and win-build.ps1, and document the new flow in README and Copilot guidance.

Validation

  • cargo test
  • cargo build --manifest-path=apps/sl/Cargo.toml --release --target x86_64-unknown-linux-gnu
  • cargo build --manifest-path=apps/sl/Cargo.toml --release --target aarch64-unknown-linux-gnu
  • cargo zigbuild --manifest-path=apps/sl/Cargo.toml --target x86_64-pc-windows-gnu
  • cargo zigbuild --manifest-path=apps/sl/Cargo.toml --target aarch64-pc-windows-gnullvm
  • CMake installer configuration for both Windows target output directories
  • YAML, shell syntax, diff, and Prettier checks

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>
Copilot AI review requested due to automatic review settings June 19, 2026 13:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.toml to 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 and win-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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants