spark-supervisor
Process supervisor and health monitor for sovereign daemons
Brought by drakestapleton
spark-supervisor / tools / build.sh
| 1 | #!/bin/sh |
| 2 | # Compile the seeded Omega programs. A refused compile is never made executable. |
| 3 | set -eu |
| 4 | here=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) |
| 5 | OMC=${OMC:?set OMC to the pinned compiler} |
| 6 | # omega-mv 15760b5009f00485ce51669c84d0126ed19fa479 (2026-11-11). |
| 7 | pin=a5613368f427aacd73ebeee16d46f8b3203405711d4de5b860d0cbee11ce4533 |
| 8 | got=$(sha256sum "$OMC" | cut -d' ' -f1) |
| 9 | if [ "$got" != "$pin" ]; then |
| 10 | echo "build: compiler $got is not pinned $pin" >&2 |
| 11 | exit 2 |
| 12 | fi |
| 13 | mkdir -p "$here/out" |
| 14 | for 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 |
| 32 | done |