spark-connector
aien-dev/spark-connector
Brought by drakestapleton
spark-connector / build.sh
| 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. |
| 8 | set -eu |
| 9 | cd "$(dirname "$0")" |
| 10 | PIN=f4fa7951816bbd09c5eaaae6692852a70c3c305164b365027c5b683dec7d63e9 |
| 11 | OMEGA_SRC=${OMEGA_SRC:-../omega-mv} |
| 12 | OMC=${OMC:-$OMEGA_SRC/seed/out/omc} |
| 13 | got=$(sha256sum "$OMC" | cut -d' ' -f1) |
| 14 | if [ "$got" != "$PIN" ]; then |
| 15 | echo "build.sh: $OMC has sha256 $got, expected the pin $PIN" >&2 |
| 16 | exit 2 |
| 17 | fi |
| 18 | out=${RUNNER_OUT:-$PWD/build/interplane-runner} |
| 19 | mkdir -p "$(dirname "$out")" |
| 20 | prog=$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" |
| 28 | if [ -n "${RUNNER_MUTANT:-}" ]; then |
| 29 | sed -f "$RUNNER_MUTANT" "$prog" > "$prog.m" && mv "$prog.m" "$prog" |
| 30 | fi |
| 31 | sh "$OMEGA_SRC/om/tls/build.sh" "$OMC" "$prog" "$out" |
| 32 | sha256sum "$out" |