Upgrade zig toolchain to 0.15.2 - #247
Conversation
The new toolchain includes some bug fixes, most importantly the concurrency issue in the zig cache: uber#224 The wrapper had to be updated due to some changes in stdlib, and some of the paths had to be updated to reflect the structure of the recent installs. The targets OS & arch have also been swapped to reflect Zig's new naming scheme.
|
This can probably be reverted: #150 But I don't think this is being tested automatically so probably best to do separately to avoid breaking things silently |
I guess this will need to be uploaded? |
|
Created a mirror request: bazelbuild/bazel#29000 |
|
Also #248 will make future upgrades easier |
|
Sorry for the delay. It takes a while for me to sort out all the errors I ran into at Uber with this PR. The errors I got so far:
|
|
Hey @linzhp, huh that's unfortunate! I guess we're blocked on zig for (2) and (3). It looks like the issue for which we need the fix will actually only be included in 0.16, it looks like I jumped the gun here. The lib path issue is technically labeled as "urgent", so who knows, 0.16 will fix all our issues... I'd say let's wait until it is release and see where we stand then. Thanks for trying this out internally! |
Addresses the two workaround-able issues reported when testing the Zig 0.15.2 upgrade at Uber (see uber#247 discussion): 1. Zig 0.15 compiles C/C++ with UBSan instrumentation by default, which surfaces as `ld.lld: error: undefined symbol: __ubsan_handle_*` at link time. The wrapper now passes -fno-sanitize=undefined in cc mode, placed before the caller's args so an explicit -fsanitize=undefined still takes precedence. The dbg/fastbuild features repeat the flag so the intent is visible in the toolchain config. 2. Zig 0.15's linker cannot read thin archives (ziglang/zig#25694): error: unexpected token in LD script: literal: '!<thin>' Build systems like Meson create thin archives for internal static libraries via ar's `T` modifier. Since archives produced by this toolchain are also consumed by it, the wrapper's ar mode now strips the `T` modifier from the operation string and drops `--thin`, so regular archives are created instead. Both are verified against the real 0.15.2 toolchain: default compiles reference __ubsan_* symbols and -fno-sanitize=undefined removes them; `zig ar rcsT` produces a `!<thin>` archive that fails to link with exactly the error above, while the stripped `rcs` archive links fine. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Closing in favor of #259 |
The new toolchain includes some bug fixes, most importantly the concurrency issue in the zig cache: #224
The wrapper had to be updated due to some changes in stdlib, and some of the paths had to be updated to reflect the structure of the recent installs. The targets OS & arch have also been swapped to reflect Zig's new naming scheme.
Closes #224