feat(release-rust): cross-compile -pc-windows-msvc on Linux via cargo-xwin - #94
Merged
Merged
Conversation
…-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.
This was referenced Jun 3, 2026
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.
What
Teaches the reusable Rust release workflow to cross-compile
*-pc-windows-msvctargets on the Linux runner via
cargo-xwin, instead of requiring a nativeself-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 buildfor the gnu target, so consumers were forced to set
runner_windowsand build-pc-windows-msvcnatively on a self-hosted Windows box.cargo-xwinlinks withlld-linkagainst the MSVC CRT + Windows SDK downloadedby
xwin, usingclang/clang-clas the C compiler — producing real MSVC-ABIbinaries (x64 and arm64) from Linux, with
aws-lc-sys/ringcompilingcleanly. Verified locally for both
x86_64-andaarch64-pc-windows-msvc(real
PE32+executables).Routing (backward compatible)
runner_windows-pc-windows-msvc-pc-windows-gnucargo-xwinon Linuxcrosson LinuxExisting consumers that set
runner_windowsare unaffected.Changes
use_xwinmatrix flag.Install xwin toolchainstep (clang lld llvm nasm cmake+cargo-xwin),gated on
use_xwin. Assumes Debian/Ubuntu Linux runners withsudo/apt.cargo xwin buildforuse_xwintargets.Release note
v9is consumed only by kache; once merged, retagv9to this commit.