- Use rec-less, overlay-style overridable recursive attributes (in effect since
NixOS#119942);
- Add decoration hooks over installCheckPhase
- Use doInstallCheck instead of doCheck.
- Directly sets env.ZIG_GLOBAL_CACHE_DIR instead of using preBuild
- Add meta.changelog
Relevant upstream issue: ziglang/zig#14559
The patch is a backport of fixes that landed in zig-master and can
be removed with zig-0.11 release.
Additionally, make sure we link statically against LLVM to avoid
unpleasant runtime surprises originating from mixing static and
dynamic LLVM libraries.
Finally, unbreak Zig 0.10.1 on macOS.
26b9a2f4a1 changes Zig 0.10 to build the
compiler (notably *not* its outputs, at least not by default) with
its baseline CPU target, but we should ideally do it for both versions
to increase reproducibility, as well as increase the number of users who
are able to use Hydra-provided Zig binaries.
This also adds a comment above the flag in 0.10, to explain why we're adding
the flag, as we do with the RPATH one.
See https://github.com/NixOS/nixpkgs/issues/214356 and https://github.com/NixOS/nixpkgs/issues/185665
for further context.
On Linux, upgrade Zig to version 0.10.1.
On macOS/Darwin, Zig version 0.10.1 is broken, so keep 0.9.1.
Several Zig-using packages are broken with Zig version 0.10.1, so pin
those packages to Zig version 0.9.1.
Several Zig-using packages are broken with a newer version of Zig, and
other packages are blocked on a Zig upgrade.
Prepare for two Zig versions side-by-side by renaming default.nix to
0.9.1.nix.
It looks like https://github.com/NixOS/nixpkgs/pull/88248 broke the
build for zig.
The error you get when building zig on the current master branch is:
```
Scanning dependencies of target zig_build_libstage2
: CommandLine Error: Option 'polly' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
make[2]: *** [CMakeFiles/zig_build_libstage2.dir/build.make:77: CMakeFiles/zig_build_libstage2] Error 1
make[1]: *** [CMakeFiles/Makefile2:252: CMakeFiles/zig_build_libstage2.dir/all] Error 2
make: *** [Makefile:150: all] Error 2
```
The patch that added polly into some build args was likely necessary
only for LLVM 10.0.0 and when that was updated to 10.0.1 it stopped
working or became unnecessary. With this patch removed, zig builds fine
and passes the tests.