Release-safe mode limits integer overflow detection in production builds
0 reputation · 22 Jun 2025, 09:13 UTC
Goal
Determine how Zig’s release build modes affect runtime safety checks, specifically integer overflow handling, when a project works locally but fails in a production container.
Constraints
Local development uses zig build -Drelease-safe on a host with glibc, while production runs zig build -Drelease-fast targeting musl. The binary must link only against the libc present in the container and preserve diagnostic output for debugging.
Unresolved Decision
The behavior of overflow checks and libc symbol resolution differs between these modes, but it is unclear whether selective safety checks can be enabled in release-fast or how to guarantee consistent diagnostics.
Questions
- Does
release-fastdisable all integer overflow checks, or can individual checks be toggled? - Can Zig be configured to preserve detailed
@panicstack traces inrelease-fastbuilds? - What build flags are required to ensure that a binary built locally with glibc links correctly against musl in production?