Skip to content

feat(release-rust): cross-compile -pc-windows-msvc on Linux via cargo-xwin - #94

Merged
emmanuelm41 merged 1 commit into
mainfrom
feat/release-rust-xwin-winarm64
Jun 3, 2026
Merged

feat(release-rust): cross-compile -pc-windows-msvc on Linux via cargo-xwin#94
emmanuelm41 merged 1 commit into
mainfrom
feat/release-rust-xwin-winarm64

Conversation

@emmanuelm41

Copy link
Copy Markdown
Member

What

Teaches the reusable Rust release workflow to cross-compile *-pc-windows-msvc
targets on the Linux runner via cargo-xwin, instead of requiring a native
self-hosted Windows runner.

Why

The Linux cross path used cross (Docker/MinGW), which only produces
-pc-windows-gnu. kache's native-C TLS deps (aws-lc-sys, ring) don't build
for the gnu target, so consumers were forced to set runner_windows and build
-pc-windows-msvc natively on a self-hosted Windows box.

cargo-xwin links with lld-link against the MSVC CRT + Windows SDK downloaded
by xwin, using clang/clang-cl as the C compiler — producing real MSVC-ABI
binaries (x64 and arm64) from Linux, with aws-lc-sys/ring compiling
cleanly. Verified locally for both x86_64- and aarch64-pc-windows-msvc
(real PE32+ executables).

Routing (backward compatible)

runner_windows -pc-windows-msvc -pc-windows-gnu
set native on the Windows runner native on the Windows runner
empty (default) cargo-xwin on Linux cross on Linux

Existing consumers that set runner_windows are unaffected.

Changes

  • New per-target use_xwin matrix flag.
  • Install xwin toolchain step (clang lld llvm nasm cmake + cargo-xwin),
    gated on use_xwin. Assumes Debian/Ubuntu Linux runners with sudo/apt.
  • Build step dispatches cargo xwin build for use_xwin targets.

Release note

v9 is consumed only by kache; once merged, retag v9 to this commit.

…-xwin

The Linux cross path previously used `cross` (Docker/MinGW), which can only
produce `-pc-windows-gnu`. Native-C TLS deps (aws-lc-sys, ring) don't build
for the gnu target, which forced consumers to build `-pc-windows-msvc`
natively on a self-hosted Windows runner.

cargo-xwin links with lld-link against the MSVC CRT + Windows SDK that `xwin`
downloads, using clang/clang-cl as the C compiler — producing real MSVC-ABI
binaries (x64 AND arm64) from a Linux host, with aws-lc-sys/ring compiling
cleanly. Verified locally for both x86_64- and aarch64-pc-windows-msvc.

Routing (backward compatible):
- runner_windows set   -> Windows targets build natively (unchanged)
- runner_windows empty -> -pc-windows-msvc via cargo-xwin, -gnu via `cross`

Adds an `Install xwin toolchain` step (clang/lld/llvm/nasm/cmake + cargo-xwin)
gated on the new per-target use_xwin matrix flag.
@emmanuelm41
emmanuelm41 merged commit 1df30b8 into main Jun 3, 2026
1 check passed
@emmanuelm41
emmanuelm41 deleted the feat/release-rust-xwin-winarm64 branch June 3, 2026 12:22
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.

1 participant