feat: Add Windows x86_64 cross-compilation via Zig#21383
Merged
Conversation
ludamad
approved these changes
Mar 13, 2026
## Summary - Adds a `zig-amd64-windows` CMake preset to cross-compile `bb.exe` and `libbb-external.a` for Windows x86_64 using the Zig toolchain (MinGW target) - Windows binaries are built as part of release flows and published alongside existing cross-compiled assets (Linux ARM64, macOS, iOS, Android) - Fixes ~20 compatibility issues for the MinGW/Windows target: `std::filesystem::path` overloads, `winsock2.h` for network byte order, BCryptGenRandom for CSPRNG, `mmap` exclusion, Windows LLP64 `size_t` mismatches, `psapi.h` include ordering, and more ## Test plan Builds. Binary tested on windows 11 vm (available now on mainframe, similar to macos).
Collaborator
|
❌ Failed to cherry-pick to |
nventuro
added a commit
that referenced
this pull request
Mar 26, 2026
…2056) ## Summary Fixes the v4 nightly build failure (`build_cross_windows amd64-windows`). On Windows (MinGW), `::write()` takes `unsigned int` for the count parameter, not `size_t`. The implicit conversion triggers `-Wshorten-64-to-32` which is an error under `-Werror`. This is a minimal one-line fix — the same fix already exists on `next` via PR #21383. CI log of the failure: http://ci.aztec-labs.com/672ba34595788ff5 ClaudeBox log: https://claudebox.work/s/fe9af88896e7e6d6?run=3
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.
Summary
zig-amd64-windowsCMake preset to cross-compilebb.exeandlibbb-external.afor Windows x86_64 using the Zig toolchain (MinGW target)std::filesystem::pathoverloads,winsock2.hfor network byte order, BCryptGenRandom for CSPRNG,mmapexclusion, Windows LLP64size_tmismatches,psapi.hinclude ordering, and moreTest plan
Builds. Binary tested on windows 11 vm (available now on mainframe, similar to macos).