interplane.Get Omega
Read in your language

omega-mission

Omega Mission: seeded-Omega mission orchestrator (hash-chained journal, tiered command checks). Host-tested; live dispatch not yet run.

Brought by drakestapleton

branch main Branches Tags History

omega-mission / build.sh

21 lines · 994 bytes Raw Blame History
1#!/bin/sh
2set -eu
3cd "$(dirname "$0")"
4OMEGA_MV=${OMEGA_MV:-../omega-mv}
5OMC_PIN=cfd96b48b0460ab5557853d6856f9c741b96ac8d0d624e06198defb4cbfa0d8a
6SOURCE_PIN=6fbc6cbe4bfa4092608e2b5f06d2e8f537893992
7[ "$(git -C "$OMEGA_MV" rev-parse HEAD)" = "$SOURCE_PIN" ] || { echo 'wrong omega-mv source pin' >&2; exit 2; }
8[ "$(sha256sum "$OMEGA_MV/seed/out/omc" | cut -d' ' -f1)" = "$OMC_PIN" ] || { echo 'wrong compiler pin' >&2; exit 2; }
9mkdir -p build
10# A failed compile must not leave an older binary or stamp behind.
11rm -f build/mission build/mission.head
12{ printf 'om2\n'; cat sha.om mission.om journal.om; } > build/composed.om
13"$OMEGA_MV/seed/out/omc" < build/composed.om > build/mission.new
14chmod +x build/mission.new
15mv build/mission.new build/mission
16# Stamp binds the binary to a commit only when the compiled sources equal HEAD.
17if git diff --quiet HEAD -- sha.om mission.om journal.om 2>/dev/null; then
18 git rev-parse HEAD > build/mission.head
19else
20 echo dirty > build/mission.head
21fi