interplane-forge
INTERPLANE Forge
Brought by drakestapleton
interplane-forge / collab / tests / tbuild.sh
| 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. |
| 7 | set -u |
| 8 | OUT=$1 |
| 9 | cd "$(dirname "$0")/../.." || exit 1 |
| 10 | OMV=$HOME/work/flux/omega-mv |
| 11 | CORES=${CORES:-14} |
| 12 | S=(-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" |
| 18 | if ! 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 |
| 20 | fi |
| 21 | chmod 755 "$OUT" |