diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-26 12:55:23 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-26 12:55:23 +0200 |
| commit | f893a2019e7ad57a57154926c8e0e01aa99aa473 (patch) | |
| tree | fc3b61fab66c1640c31b1c8e67d78d60e3993eab | |
| parent | e6cb5937be7f009eab11f3cf85205d1fde25eb48 (diff) | |
| download | colitur-f893a2019e7ad57a57154926c8e0e01aa99aa473.tar.gz colitur-f893a2019e7ad57a57154926c8e0e01aa99aa473.zip | |
fix(install): ship the OF runtime data files, guard the installed layout
data/dune's install stanza named only the four EF runtime files, so a
`dune install`ed colitur exited 2 on any --rite of invocation
(`failed to load .../data/of/calendar-2002.sexp`) -- the branch's
headline feature was dead on an installed binary. Add all 15 OF
files (calendar-2002.sexp, the 13 amendments/*.sexp, lectionary.sexp)
to the (files ...) stanza, following the existing ef/ entries' form
and the stanza's own stated rule (deliberately not the litcal
allow-list, a test fixture, same reasoning already given for the EF
pair).
Add a regression guard for the class of bug, not just this instance:
`make check-install` performs a real `dune install --prefix <scratch>`
and runs both rites against the INSTALLED binary, asserting exit 0
and the expected day count. test/cli.t's cram sandbox binds
%{bin:colitur} inside the build tree, where data_dir()/of_data_dir()'s
build-tree fallback candidate resolves even when the installed one is
missing entirely -- so no cram test could have caught this. Wired
into `make check` (unlike check-schema/check-templates/check-citations,
which skip when an optional external tool is absent) since installing
needs nothing beyond what building already needs. Verified the guard
has teeth: reverted data/dune to the pre-fix version and confirmed
check-install fails loudly naming the missing file.
| -rw-r--r-- | Makefile | 27 | ||||
| -rw-r--r-- | data/dune | 21 |
2 files changed, 47 insertions, 1 deletions
@@ -34,6 +34,33 @@ test: ## fast suite (~5s): properties sample 200 years check: ## full gate (~2min): every year 1583-9999, not a sample COLITUR_EXHAUSTIVE_SWEEP=1 $(DUNE) dune test --force + $(MAKE) check-install + +# C1 fix-wave regression guard (final-review.md, 2026-08-25-colitur-of-phases-3-5): +# a `dune install`ed colitur exited 2 on `--rite of` because data/dune never +# named the OF runtime files -- and nothing in the suite caught it, because +# test/cli.t's cram sandbox binds %{bin:colitur} inside the BUILD TREE, where +# [data_dir]/[of_data_dir]'s build-tree fallback candidate resolves even when +# the installed one is missing entirely. This target is the guard: it installs +# to a scratch prefix -- the exact `dune install --prefix X` the review used to +# reproduce C1, not a hand-rolled copy -- and runs BOTH rites against the +# installed binary only, asserting exit 0 and the expected day count. Wired +# into `check` (not opt-in like check-schema/check-templates/check-citations +# above, which skip when an external tool is missing) because installing needs +# nothing beyond what building already needs. +check-install: build ## regression guard: run an INSTALLED colitur (both rites), not just the build tree + @set -e; \ + scratch=$$(mktemp -d); \ + trap 'rm -rf "$$scratch"' EXIT; \ + $(DUNE) dune install --prefix "$$scratch" >/dev/null; \ + test -f "$$scratch/share/colitur/of/calendar-2002.sexp" || \ + { echo "check-install: share/colitur/of/calendar-2002.sexp was not installed" >&2; exit 1; }; \ + ef_lines=$$("$$scratch/bin/colitur" day 2026 | wc -l); \ + of_lines=$$("$$scratch/bin/colitur" day --rite of 2026 | wc -l); \ + test "$$ef_lines" -eq 365 || { echo "check-install: installed 'day 2026' (EF) printed $$ef_lines lines, want 365" >&2; exit 1; }; \ + test "$$of_lines" -eq 365 || { echo "check-install: installed 'day --rite of 2026' printed $$of_lines lines, want 365" >&2; exit 1; }; \ + "$$scratch/bin/colitur" readings --rite of 2026 >/dev/null; \ + echo "check-install: installed EF ($$ef_lines lines) and OF ($$of_lines lines) both run cleanly from a scratch prefix" check-schema: build ## validate emitted XML against schema/colitur-v1.xsd (needs xmllint; skipped if absent) @if command -v xmllint >/dev/null 2>&1; then \ @@ -33,4 +33,23 @@ ; The Benedictine one is deliberately two entries long, and the comment ; block explaining why is the point of shipping it. (ef/examples/poland.ini as examples/poland.ini) - (ef/examples/benedictine.ini as examples/benedictine.ini))) + (ef/examples/benedictine.ini as examples/benedictine.ini) + ; The OF runtime data files, installed into <prefix>/share/colitur/of/ -- + ; same reasoning as the ef/ set above. Deliberately NOT + ; of/expected-divergences-litcal.sexp: that is a test fixture, read only by + ; test_oracle_of.ml, same as the EF allow-lists above. + (of/calendar-2002.sexp as of/calendar-2002.sexp) + (of/lectionary.sexp as of/lectionary.sexp) + (of/amendments/001-padre-pio.sexp as of/amendments/001-padre-pio.sexp) + (of/amendments/002-juan-diego-cuauhtlatoatzin.sexp as of/amendments/002-juan-diego-cuauhtlatoatzin.sexp) + (of/amendments/003-our-lady-of-guadalupe.sexp as of/amendments/003-our-lady-of-guadalupe.sexp) + (of/amendments/004-john-xxiii-john-paul-ii.sexp as of/amendments/004-john-xxiii-john-paul-ii.sexp) + (of/amendments/005-mary-magdalene-rank.sexp as of/amendments/005-mary-magdalene-rank.sexp) + (of/amendments/006-mary-mother-of-the-church.sexp as of/amendments/006-mary-mother-of-the-church.sexp) + (of/amendments/007-paul-vi.sexp as of/amendments/007-paul-vi.sexp) + (of/amendments/008-our-lady-of-loreto.sexp as of/amendments/008-our-lady-of-loreto.sexp) + (of/amendments/009-faustina-kowalska.sexp as of/amendments/009-faustina-kowalska.sexp) + (of/amendments/010-narek-avila-hildegard.sexp as of/amendments/010-narek-avila-hildegard.sexp) + (of/amendments/011-martha-mary-lazarus.sexp as of/amendments/011-martha-mary-lazarus.sexp) + (of/amendments/012-teresa-of-calcutta.sexp as of/amendments/012-teresa-of-calcutta.sexp) + (of/amendments/013-john-henry-newman.sexp as of/amendments/013-john-henry-newman.sexp))) |
