Artifact 2849961a82b9dc847788b2f2fa3dca1407590eecb616c549ed0dee1225f4c45e:
- File
tools/gate.sh
— part of check-in
[231b7b615b]
at
2026-11-18 18:37:32
on branch trunk
— The gate builds and fuzzes first, and runs one stage under the forge's umask
make gate now starts with a cheap run, to build/fast.log: everything make check needs is built, not run, on a fresh build/dev with gcc 16 and again with clang, warnings being errors, and make fuzz runs every target once. A compile error or a fuzz finding stops the gate there instead of after the long suites; on this machine that stage took 18 minutes against 70 for the whole gate. make all still fuzzes again later. New target: make check-build.
The no-user stage also runs under umask 002, which is the forge runner's, so a test that depends on files being private fails here first.
The gate's summary listed only the first eight suites, which hid the https suite; it now lists them all and the fuzz counts. (user: dmestas, size: 2427) [annotate] [blame] [check-ins using]
#!/bin/sh # The whole local gate, one run after another, stopping at the first failure. # The first run is the cheap one: it builds everything with both compilers # (warnings are errors) and runs every fuzz target once, so a compile error or # a fuzz finding stops the gate in minutes rather than after the long suites. # rm -rf build/dev; make check-build CC=gcc-16; # rm -rf build/dev; make check-build; make fuzz -> build/fast.log # rm -rf build/dev; make check CC=gcc-16 -> build/check-gcc.log # rm -rf build/dev; make all -> build/all.log # (umask 002; env -u USER -u LOGNAME make check) -> build/check-nouser.log # (umask 002 is the forge runner's: files the tests make are group-writable) # (umask 027; make check) -> build/check-umask.log # The last two reuse the dev build that `make all` just made: same compiler, # same flags, so make finds nothing to rebuild. Then, for each run that # started, its exit status, its seconds and its summary lines. # usage: gate.sh (env: GATE_GCC, the second compiler; default gcc-16) set -u gcc=${GATE_GCC:-gcc-16} if ! command -v "$gcc" >/dev/null 2>&1; then echo "gate: $gcc is not installed; the first run needs it" >&2 exit 1 fi mkdir -p build done_runs= report() { for n in $done_runs; do printf '%s: exit %s, %ss\n' "$n" "$(cat "build/$n.rc")" "$(cat "build/$n.sec")" grep -E '^(unit: [0-9]+ checks|[a-z_]+\.sh: [0-9]+ cases), [0-9]+ failed$' "build/$n.log" | head -16 grep -E '^fuzz [a-z]+: (number_of_executed_units|mutation loop)' "build/$n.log" | head -16 grep '^skip ' "build/$n.log" | sort -u | head -5 done } # run NAME COMMAND...: output to build/NAME.log, status to build/NAME.rc run() { n=$1; shift echo "gate: $n" start=$(date +%s) "$@" >"build/$n.log" 2>&1 echo $? >"build/$n.rc" echo $(($(date +%s) - start)) >"build/$n.sec" done_runs="$done_runs $n" [ "$(cat "build/$n.rc")" = 0 ] } run fast sh -c "rm -rf build/dev && make check-build CC=$gcc && rm -rf build/dev && make check-build && make fuzz" && run check-gcc sh -c "rm -rf build/dev; make check CC=$gcc" && run all sh -c 'rm -rf build/dev; make all' && run check-nouser sh -c 'umask 002; env -u USER -u LOGNAME make check' && run check-umask sh -c 'umask 027; make check' rc=$? report [ $rc = 0 ] && echo "gate: passed" || echo "gate: FAILED" >&2 exit $rc