Skip to content

Commit 599a889

Browse files
claudehyperpolymath
authored andcommitted
fix(ci): soundness gate must not assume bare dune on PATH
Property 5 ran `dune build test/xfail/test_xfail_pins.exe`, which fails in CI where dune is only reachable via `opam exec --` (not bare) — greening locally but red in CI ("ERROR (property 5): cannot build ..."), which is how it slipped past a local run. The harness exe is already built by the `dune build` / `dune runtest` steps that run before this gate, so prefer the pre-built binary and only build (with whatever dune is available) if it is missing; fail closed otherwise. Verified by running the gate with the exe pre-built and `dune`/`opam` removed from PATH (the CI condition) — it passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BbxKhXQwTvVgkYDgBMLJoa
1 parent 874e36c commit 599a889

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

tools/check-soundness-ledger.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,21 @@ check_pins() {
253253
local pins; pins="$(pinned_row_pins)"
254254
[ -n "$pins" ] || { note "ERROR (property 5): no 'residual (pinned)'/'open (tracked)' rows found (fail closed)"; return 1; }
255255
printf '%s\n' "$pins" | grep -q '^NOPIN$' && { note "ERROR (property 5): a pinned/open row names no test_* pin (fail closed)"; return 1; }
256-
dune build "$XFAIL_EXE" >/dev/null 2>&1 || { note "ERROR (property 5): cannot build ${XFAIL_EXE}"; return 1; }
257-
local report; report="$(AFFINE_FIXTURES="$PWD/test/e2e/fixtures" "_build/default/${XFAIL_EXE}" 2>&1 || true)"
256+
# Run the pin harness. CI builds it in the `dune build` / `dune runtest` steps
257+
# before this gate, so prefer the pre-built binary and do NOT assume a bare
258+
# `dune` is on PATH (in CI dune is reached via `opam exec --`, not bare). Only
259+
# build if the exe is missing (e.g. a standalone local run), with whatever dune
260+
# is available. Fail closed if it still isn't there.
261+
local exe="_build/default/${XFAIL_EXE}"
262+
if [ ! -x "$exe" ]; then
263+
if command -v dune >/dev/null 2>&1; then
264+
dune build "$XFAIL_EXE" >/dev/null 2>&1 || true
265+
elif command -v opam >/dev/null 2>&1; then
266+
opam exec -- dune build "$XFAIL_EXE" >/dev/null 2>&1 || true
267+
fi
268+
fi
269+
[ -x "$exe" ] || { note "ERROR (property 5): pin harness ${exe} not built (run dune build first)"; return 1; }
270+
local report; report="$(AFFINE_FIXTURES="$PWD/test/e2e/fixtures" "$exe" 2>&1 || true)"
258271
local pin r=0
259272
while IFS= read -r pin; do
260273
[ -z "$pin" ] && continue

0 commit comments

Comments
 (0)