aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-08-26 12:55:23 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-08-26 12:55:23 +0200
commitf893a2019e7ad57a57154926c8e0e01aa99aa473 (patch)
treefc3b61fab66c1640c31b1c8e67d78d60e3993eab /Makefile
parente6cb5937be7f009eab11f3cf85205d1fde25eb48 (diff)
downloadcolitur-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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index d82d320..13df353 100644
--- a/Makefile
+++ b/Makefile
@@ -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 \