Skip to content

feat: Add Windows x86_64 cross-compilation via Zig#21383

Merged
AztecBot merged 1 commit into
nextfrom
cl/bb_win32
Mar 13, 2026
Merged

feat: Add Windows x86_64 cross-compilation via Zig#21383
AztecBot merged 1 commit into
nextfrom
cl/bb_win32

Conversation

@charlielye

@charlielye charlielye commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

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).

@charlielye charlielye added the ci-release-pr Creates a development tag and runs the release suite label Mar 12, 2026
@AztecBot AztecBot removed the ci-release-pr Creates a development tag and runs the release suite label Mar 12, 2026
@charlielye charlielye requested a review from ludamad March 13, 2026 14:34
## 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).
@AztecBot AztecBot enabled auto-merge March 13, 2026 14:40
@AztecBot AztecBot added this pull request to the merge queue Mar 13, 2026
Merged via the queue into next with commit 5f4c27c Mar 13, 2026
19 checks passed
@AztecBot AztecBot deleted the cl/bb_win32 branch March 13, 2026 15:27
@AztecBot

Copy link
Copy Markdown
Collaborator

❌ Failed to cherry-pick to v4-next due to conflicts. (🤖) View backport run.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants