interplane.Get Omega
Read in your language

interplane-forge

INTERPLANE Forge

Brought by drakestapleton

branch main Branches Tags History

interplane-forge / collab / tests / tbuild.sh

21 lines · 1198 bytes Raw Blame History
1#!/bin/bash
2# collab/tests/tbuild.sh OUT: build a TEST forged for the collab tests (never the live one).
3# Units: `sh run.sh units`; collab/* from the working tree, every other repo unit from HEAD (another
4# slice's unfinished edit cannot break this build). The test copy alone is rewritten: main.om's port
5# (PORT), tfdata (DATA, a private data dir), optional tfstore (STORE), tfrids (RIDS) and one extra sed
6# expression (SEDX). Cores: CORES (default 14). Prints the omc error and exits nonzero on failure.
7set -u
8OUT=$1
9cd "$(dirname "$0")/../.." || exit 1
10OMV=$HOME/work/flux/omega-mv
11CORES=${CORES:-14}
12S=(-e "s/18480/$PORT/g" -e "s|^text tfdata \".*\"|text tfdata \"$DATA\"|")
13[ -n "${STORE:-}" ] && S+=(-e "s|^text tfstore \".*\"|text tfstore \"$STORE\"|")
14[ -n "${RIDS:-}" ] && S+=(-e "s|^text tfrids \".*\"|text tfrids \"$RIDS\"|")
15[ -n "${SEDX:-}" ] && S+=(-e "$SEDX")
16{ printf 'om2\n'; for u in $(sh run.sh units); do case $u in /*|collab/*) cat "$u";; *) git show "HEAD:$u";; esac; done; } \
17 | sed "${S[@]}" > "$OUT.om"
18if ! taskset -c "$CORES" nice -n 10 "$OMV/seed/out/omc" < "$OUT.om" > "$OUT" 2> "$OUT.err"; then
19 echo "BUILD FAILED: $(cat "$OUT.err")"; exit 1
20fi
21chmod 755 "$OUT"