Skip to content

Upgrade Zig to 0.14.0, add glibc 2.39-2.41#256

Open
zpon wants to merge 6 commits into
uber:mainfrom
zpon:sjuul/new-libc
Open

Upgrade Zig to 0.14.0, add glibc 2.39-2.41#256
zpon wants to merge 6 commits into
uber:mainfrom
zpon:sjuul/new-libc

Conversation

@zpon

@zpon zpon commented Jun 24, 2026

Copy link
Copy Markdown
  • Bump Zig SDK from 0.12.0 to 0.14.0 with updated SHA256 hashes
  • Add glibc versions 2.39, 2.40, 2.41 to supported targets
  • Fix zig-wrapper.zig for Zig 0.14.0 API changes:
    • std.ChildProcess → std.process.Child
    • std.ComptimeStringMap → std.StaticStringMap with initComptime()
    • mem.split → mem.splitScalar

Co-Authored-By: Claude Sonnet 4.6 (1M context) noreply@anthropic.com

- Bump Zig SDK from 0.12.0 to 0.14.0 with updated SHA256 hashes
- Add glibc versions 2.39, 2.40, 2.41 to supported targets
- Fix zig-wrapper.zig for Zig 0.14.0 API changes:
  - std.ChildProcess → std.process.Child
  - std.ComptimeStringMap → std.StaticStringMap with initComptime()
  - mem.split → mem.splitScalar

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@CLAassistant

CLAassistant commented Jun 24, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

zpon and others added 5 commits June 25, 2026 05:37
- Add generic-musl to WASI include path: Zig 0.14.0 moved features.h
  out of wasm-wasi-musl/ into generic-musl/, but wasm-wasi-musl/stdio.h
  still includes it, causing compilation failures.

- Work around zig lld colon-link bug (ziglang/zig#23287): zig 0.14.0
  lld does not handle -l:filename syntax. Resolve such flags to full
  paths in zig-wrapper by searching the -L directories.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Zig 0.14.0 no longer auto-links against the C library for build-exe
targets. cp.zig uses stdlib functions (copyFile, argsAlloc) that call
macOS system APIs, requiring explicit -lc.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Zig 0.14.0 dropped the implicit -D_GNU_SOURCE that 0.12.0 passed.
Without it, glibc headers gate POSIX extensions (posix_openpt, grantpt,
unlockpt, ptsname, ...) behind __USE_XOPEN_EXTENDED/__USE_XOPEN2KXSI,
which are only enabled when _XOPEN_SOURCE>=500/600. This broke CGO
stdlib compilation on Windows cross-compiling to Linux (internal/testpty).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Zig 0.14.0 locates the macOS SDK by running xcrun --show-sdk-path.
Bazel sandboxes clear PATH via 'exec env -', making xcrun unfindable
and causing zig build-exe to fail with undefined system symbols
(abort, arc4random_buf, fcopyfile, etc.).

Restore /usr/bin:/bin in PATH on macOS so xcrun can be found.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants