interplane.Get Omega
Read in your language

spark-connector

aien-dev/spark-connector

Brought by drakestapleton

branch main Branches Tags History

spark-connector / build.sh

32 lines · 1350 bytes Raw Blame History
1#!/bin/sh
2# Build interplane-runner with the pinned seeded compiler (compose and compile only).
3# OMEGA_SRC=/path/to/omega-mv ./build.sh omega-mv checkout at b2ad967e
4# Output: build/interplane-runner and its composed unit build/interplane-runner.unit.om.
5# The unit is: om2, the om/tls client units (om/tls/build.sh, which also writes the FIPS integrity
6# value into the binary), seed/net/http.om, seed/net/https.om, then runner/*.om in runner/UNITS order.
7# RUNNER_MUTANT=FILE (gates only) applies FILE, a sed script, to the program part before compiling.
8set -eu
9cd "$(dirname "$0")"
10PIN=f4fa7951816bbd09c5eaaae6692852a70c3c305164b365027c5b683dec7d63e9
11OMEGA_SRC=${OMEGA_SRC:-../omega-mv}
12OMC=${OMC:-$OMEGA_SRC/seed/out/omc}
13got=$(sha256sum "$OMC" | cut -d' ' -f1)
14if [ "$got" != "$PIN" ]; then
15 echo "build.sh: $OMC has sha256 $got, expected the pin $PIN" >&2
16 exit 2
17fi
18out=${RUNNER_OUT:-$PWD/build/interplane-runner}
19mkdir -p "$(dirname "$out")"
20prog=$out.prog.om
21{
22 cat "$OMEGA_SRC/seed/net/http.om" "$OMEGA_SRC/seed/net/https.om"
23 while read -r f; do
24 case "$f" in ''|'#'*) continue ;; esac
25 cat "runner/$f"
26 done < runner/UNITS
27} > "$prog"
28if [ -n "${RUNNER_MUTANT:-}" ]; then
29 sed -f "$RUNNER_MUTANT" "$prog" > "$prog.m" && mv "$prog.m" "$prog"
30fi
31sh "$OMEGA_SRC/om/tls/build.sh" "$OMC" "$prog" "$out"
32sha256sum "$out"