Installation

Prerequisites

ToolVersionWhy
Zig0.14.1 or 0.15.2builds everything
CUEv0.16.0validates and exports the config
Python 3any 3.xgen_build_spec.sh uses it to emit Zig from CUE's JSON

Those two Zig versions are the tested ones. build.zig uses the root_module API, so expect older releases to fail at configuration.

macOS:

brew install zig cue

Linux: get Zig from <https://ziglang.org/download/> and CUE from <https://cuelang.org/docs/introduction/installation/>, or go install cuelang.org/go/cmd/cue@latest.

Python 3 ships with macOS and every mainstream Linux distribution.

git clone https://github.com/godofecht/azazel.git
cd azazel
./setup.sh

setup.sh checks the toolchain, generates build_spec.zig, builds, and runs the tests. It is safe to run repeatedly and exits non-zero on the first failure.

$ ./setup.sh

== Checking prerequisites
  zig      0.15.2   (/opt/homebrew/bin/zig)
  cue      v0.16.0   (/opt/homebrew/bin/cue)
  python3  3.9.6   (/usr/bin/python3)

== Generating build_spec.zig
Generated build_spec.zig

== Building

== Testing

Build Summary: 7/7 steps succeeded; 56/56 tests passed
test success
+- run test 12 passed 1ms MaxRSS:1M
|  +- compile test Debug native cached 40ms MaxRSS:34M
+- run test 9 passed 1ms MaxRSS:2M
|  +- compile test Debug native cached 40ms MaxRSS:34M
+- run test 35 passed 1ms MaxRSS:1M
   +- compile test Debug native cached 40ms MaxRSS:34M


Done.

  ./zig-out/bin/app          run the sample executable
  $EDITOR project.cue        declare your modules
  ./gen_build_spec.sh        regenerate after every project.cue change
  docs/WIKI.md               full reference

Other invocations:

./setup.sh --check-only              report tool versions and stop
./setup.sh --examples                also build and test everything in examples/
ZIG=/path/to/zig ./setup.sh          use a specific Zig binary
CUE=/path/to/cue ./setup.sh          use a specific CUE binary
./setup.sh --help

If a tool is missing, it says so and points at an installer:

$ ZIG=/nonexistent/zig ./setup.sh --check-only

== Checking prerequisites
  zig      MISSING
           macOS:  brew install zig
           Linux:  https://ziglang.org/download/  (or your package manager)
           Any:    https://github.com/marler8997/zigup
           Already installed elsewhere? Run: ZIG=/path/to/zig ./setup.sh
  cue      v0.16.0   (/opt/homebrew/bin/cue)
  python3  3.9.6   (/usr/bin/python3)
error: install the tools above, then run ./setup.sh again