1
Fork 0
hermetic_cc_toolchain/contrib/own_zig.md

1.0 KiB

How to test a different version of zig

Assume you want to test an unreleased version of zig. Here's how:

  1. Clone zig-bootstrap:

    $ git clone https://github.com/ziglang/zig-bootstrap $ cd zig-bootstrap

  2. Copy over zig/ from ~/zig:

    $ rm -fr zig $ git -C ~/zig archive --format=tar --prefix=zig/ master | tar -xv

  3. Build it (assuming x86_64-linux):

    $ vim build # edit ZIG_VERSION ./build -j(nproc) x86_64-linux-musl baseline

  4. Pack the release tarball:

    $ ~/code/bazel-zig-cc/makerel

This gives us a usable Zig SDK. Now:

  • Send the .tar.xz it to your mirror.
  • Point toolchain/defs.bzl to the new version.
  • Run tests.