interplane.Get Omega
Read in your language

spark-supervisor

Process supervisor and health monitor for sovereign daemons

Brought by drakestapleton

branch main Branches Tags History

spark-supervisor / tools / build.sh

32 lines · 1290 bytes Raw Blame History
1#!/bin/sh
2# Compile the seeded Omega programs. A refused compile is never made executable.
3set -eu
4here=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
5OMC=${OMC:?set OMC to the pinned compiler}
6# omega-mv 15760b5009f00485ce51669c84d0126ed19fa479 (2026-11-11).
7pin=a5613368f427aacd73ebeee16d46f8b3203405711d4de5b860d0cbee11ce4533
8got=$(sha256sum "$OMC" | cut -d' ' -f1)
9if [ "$got" != "$pin" ]; then
10 echo "build: compiler $got is not pinned $pin" >&2
11 exit 2
12fi
13mkdir -p "$here/out"
14for p in supervise root watch; do
15 case $p in
16 supervise) bin=aien-supervise; units="contract supervise limits limited services" ;;
17 root) bin=aien-supervise-root; units= ;;
18 watch) bin=aien-watch; units= ;;
19 esac
20 if { cat "$here/om/lib.om" "$here/om/syscalls.om"; if [ "$p" = supervise ]; then for u in $units; do cat "$here/om/$u.om"; printf "\n"; done; else cat "$here/om/$p.om"; fi; } | "$OMC" > "$here/out/$bin.new" 2> "$here/out/$bin.err"; then
21 chmod 0755 "$here/out/$bin.new"
22 mv -f "$here/out/$bin.new" "$here/out/$bin"
23 rm -f "$here/out/$bin.err"
24 echo "built out/$bin $(sha256sum "$here/out/$bin" | cut -d' ' -f1)"
25 else
26 rc=$?
27 rm -f "$here/out/$bin.new"
28 echo "build: compiler refused $p (rc=$rc)" >&2
29 cat "$here/out/$bin.err" >&2
30 exit 1
31 fi
32done