RC RANDOM CHAOS

Zig Rips Package Management Out of the Compiler, Moves It to the Build System

· via Hacker News

Original source

Zig: All Package Management Functionality Moved from Compiler to Build System

Hacker News →

Andrew Kelley has relocated Zig’s package-management subcommands—zig build, fetch, init, and libc—from the compiler binary into the separate build-system process (now called “maker”). As a result, large chunks of code that were previously compiled into the compiler now ship in source form: the package fetcher, HTTP client, TLS and its crypto, the Git protocol, several compression codecs (xz, gzip, zstd, flate, zip), and all handling of build.zig.zon manifests. Because this logic is no longer baked into the compiler, users and contributors can patch it without rebuilding the whole toolchain.

The move brings concrete wins beyond hackability. The maker process is built in ReleaseSafe mode, so networking now runs with safety checks enabled, and its crypto can use host-specific CPU instructions that would normally be too rare to depend on in distributed binaries. The compiler binary shrinks about 4% (14.1 to 13.5 MiB in a no-LLVM ReleaseSmall build). The real motivation, though, is process-tree restructuring: maker is now the parent of the user’s build.zig configurer rather than a sibling, which lets a long-running zig build --watch survive reconfiguration and paves the way for a build-server protocol to unblock the ZLS language server.

The change is almost entirely non-breaking—only two flags moved to environment variables (--maker-opt to ZIG_DEBUG_MAKER, --zig-lib-dir to ZIG_LIB_DIR). It’s positioned as one of the last blockers before Zig 0.17.0, though Kelley expects the remaining follow-ups (build-server MVP, build-script watch detection, cache fixes) to slip to early August given conference commitments. The same devlog also covers substantial SPIR-V shader-backend progress and reworked @bitCast and LLVM integer-lowering semantics.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.