#!/bin/sh # Builds zena-cli from elematic/zena at the commit CONTRIBUTING.md pins, for machines without one (the # release spindle). Prints the binary's path, for ZENA. A different commit may produce a different engine. # Needs git, Node 24 or later, and a Rust toolchain. Safe to re-run: an existing checkout is reused. # # ZENA=$(./scripts/zena.sh [dir]) set -e COMMIT=a7c1d2cd0cc87f72a3b948151897ce7176f51def DIR=${1:-${TMPDIR:-/tmp}/zena-$COMMIT} if [ ! -d "$DIR/.git" ]; then git init -q "$DIR" git -C "$DIR" fetch -q --depth=1 https://github.com/elematic/zena.git "$COMMIT" git -C "$DIR" checkout -q FETCH_HEAD fi # In a checkout, zena-cli reads its CLI module (packages/zena-cli/out/zena.wasm) and the standard library # from the tree, so the build has to produce both, not just the binary. # Zena's package.json asks for Node 25, but Tangled's Nixery stops at 24, and on 24 this commit builds # engines byte-identical to a Node 26 build, so the engines check is turned off. (cd "$DIR" && npm ci --engine-strict=false --ignore-scripts --no-audit --no-fund && npm run build -w @zena-lang/zena-cli) >&2 echo "$DIR/target/release/zena-cli"