From e57fcf230bb46e05ccfc2c7266c4143bfe16dffa Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Mon, 22 Jun 2026 15:34:36 +0900 Subject: [PATCH] make: wire test-run into make test (pre-push reject gate) test-run drives runww.ww over the test/wcc/data/*/case.ww behavior and //ww:error cases, but was not a prerequisite of any aggregate, so the reject surface was ungated. With runww's arm now dual-stage, gate it. Added to the pre-push `test` target only -- not test-unit, not the test-commit content-key tier. runww execve's its children with nil envp, so a WW_PKGCACHE override cannot reach them; they fall back to the default out/.pkgcache that $(TESTS) and the byte-id gates also use. A normal prereq would let make -j overlap test-run with those writers, so test-run carries an order-only prereq (| $(TESTS) test-lang test-lang-byteid) and is scheduled strictly after every default-cache writer. No cache isolation is added: it would be inert under nil envp, and the ordering prevents the race. True per-run cache isolation stays blocked on an os envp() forwarder. --- Makefile | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index d6169a40..6c69ba02 100644 --- a/Makefile +++ b/Makefile @@ -3256,7 +3256,7 @@ sizelint: peellint: @sh tools/peellint -test: all sizelint peellint $(TESTS) test-lang test-lang-byteid +test: all sizelint peellint $(TESTS) test-lang test-lang-byteid test-run @WW=$(BIN)/ww BIN=$(BIN) sh test/run test-unit: all sizelint peellint $(TESTS) @@ -3264,12 +3264,22 @@ test-unit: all sizelint peellint $(TESTS) # ---- test-run: ww-native behavior harness (fold 2) --------------------- # Drives test/runww.ww over every test/wcc/data//case.ww, building -# and running each case through the cstage `ww` driver (T1) and checking -# its leading `//ww:` directive. The harness prints `runww: all ok` and exits -# 0 only if every case passes; the target propagates that exit code. NOT -# yet wired into `make test` (fold 6). See test/runww.ww header. +# and running each case through the cstage `ww` driver (T1, plus the ERROR +# arm's wwstage w6c_ww leg) and checking its leading `//ww:` directive. The +# harness prints `runww: all ok` and exits 0 only if every case passes; the +# target propagates that exit code. Wired into `make test` (pre-push only). +# +# runww execve's its child `ww`/`w6c_ww` with a NIL envp, so a WW_PKGCACHE= +# override can't reach them — the children write the DEFAULT out/.pkgcache, +# the same cache the recipe's $(TESTS)/byte-id gates use. The order-only +# prereqs (after `|`) force `make test -j` to schedule test-run strictly +# LAST among the prereqs, so it cannot run concurrently with any default- +# cache writer (`all`'s selfhost builds are already ordered via the normal +# `all` prereq; test-lang/test-lang-byteid use isolated caches, but ordering +# after them is belt-and-suspenders). The recipe's 990-997/pkgcache default- +# cache tests run only after ALL prereqs complete, so no overlap there. RUNWW_CASES = $(wildcard test/wcc/data/*/case.ww) -test-run: all +test-run: all | $(TESTS) test-lang test-lang-byteid @BIN=$(BIN) $(BIN)/ww run test/runww.ww $(RUNWW_CASES) # ---- test-lang: in-language @test behavior corpus (fold 2) -------------