1.0 KiB
1.0 KiB
How to test a different version of zig
Assume you want to test an unreleased version of zig. Here's how:
-
Clone zig-bootstrap:
$ git clone https://github.com/ziglang/zig-bootstrap $ cd zig-bootstrap
-
Copy over zig/ from ~/zig:
$ rm -fr zig $ tar -C ~/zig archive --format=tar --prefix=zig/ master | tar -xv
-
Build it (assuming
x86_64-linux
):$ vim build # edit ZIG_VERSION $ ./build -j$(nproc) x86_64-linux-musl baseline
-
Pack the release tarball:
$ ~/code/bazel-zig-cc/makerel
This gives us a usable Zig SDK. Now:
- Send the .tar.gz it to your mirror.
- Point toolchain/defs.bzl to the new version.
- Run tests.
Links
- ziglang/release-cutter, a script that creates binaries for ziglang.org/download.
- ziglang/zig-bootstrap, a set of scripts that compile a static Zig.