Skip to content

fix: add static_cast for Windows cross-compilation in file_io.hpp#22056

Merged
nventuro merged 2 commits into
backport-to-v4-next-stagingfrom
claudebox/fix-v4-windows-build
Mar 26, 2026
Merged

fix: add static_cast for Windows cross-compilation in file_io.hpp#22056
nventuro merged 2 commits into
backport-to-v4-next-stagingfrom
claudebox/fix-v4-windows-build

Conversation

@AztecBot

@AztecBot AztecBot commented Mar 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes Windows cross-compilation failures on v4-next.

Fix 1: file_io.hppstatic_cast<unsigned int>() on ::write() call

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.

Fix 2: polynomial_arithmetic.hppunsigned longsize_t type mismatch

The header declared unsigned long num_coeffs but the implementation (.cpp) uses const size_t num_coeffs. On Linux these are the same type, but on Windows LLP64 unsigned long is 32-bit while size_t is 64-bit, causing -Wshorten-64-to-32 when passing domain.size (size_t).

Both fixes match what already exists on next (where the polynomial code was removed entirely).

CI log of the original failure: http://ci.aztec-labs.com/672ba34595788ff5
CI log of the polynomial.cpp failure: https://github.com/AztecProtocol/aztec-packages/actions/runs/23608075427/job/68756199559

…s-compilation

On Windows (MinGW), ::write() takes unsigned int for the count parameter,
not size_t. The implicit conversion from size_t to unsigned int triggers
-Wshorten-64-to-32 which is promoted to an error by -Werror.

This fixes the v4 nightly build failure in build_cross_windows.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels Mar 26, 2026
@nventuro nventuro marked this pull request as ready for review March 26, 2026 14:01
@nventuro nventuro enabled auto-merge March 26, 2026 14:01
@AztecBot

Copy link
Copy Markdown
Collaborator Author

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/8ff9e2d9d0ffcb8c�8ff9e2d9d0ffcb8c8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_proof_fails.parallel.test.ts "does not allow submitting proof after epoch end" (240s) (code: 0) group:e2e-p2p-epoch-flakes

@nventuro nventuro merged commit 7b620da into backport-to-v4-next-staging Mar 26, 2026
9 checks passed
@nventuro nventuro deleted the claudebox/fix-v4-windows-build branch March 26, 2026 14:46
ludamad added a commit that referenced this pull request Mar 26, 2026
…l_arithmetic.hpp (#22072)

## Summary

Fixes the second Windows cross-compilation failure on v4-next (after PR
#22056 fixed the first one in file_io.hpp).

The header `polynomial_arithmetic.hpp` declares `unsigned long
num_coeffs` but the implementation (.cpp) uses `const size_t
num_coeffs`. On Linux these are the same type, but on Windows LLP64
`unsigned long` is 32-bit while `size_t` is 64-bit, causing
`-Wshorten-64-to-32` when passing `domain.size` (size_t).

This function was removed on `next` before Windows cross-compilation was
added, so it was never caught there. It's v4-specific legacy code.

CI failure:
https://github.com/AztecProtocol/aztec-packages/actions/runs/23608075427/job/68756199559

ClaudeBox log: https://claudebox.work/s/fe9af88896e7e6d6?run=8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants