Skip to content

fix(build): sync VERSION into every .el header, not just the resource - #28

Open
BuddhiLW wants to merge 1 commit into
feat/runtime-version-guardfrom
feat/sync-el-version-headers
Open

fix(build): sync VERSION into every .el header, not just the resource#28
BuddhiLW wants to merge 1 commit into
feat/runtime-version-guardfrom
feat/sync-el-version-headers

Conversation

@BuddhiLW

@BuddhiLW BuddhiLW commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Closes CLJEL-SYNC-VERSION (20260905161109-0e698b23), CLJEL-MELPA propagate-VERSION
(20260713171046-5d818865, the same concern filed twice) and CLJEL-TEST-TMPDIR
(20260905173027-253109a0).

Stacked on #27, which is stacked on #26. Bases retarget as those merge.

The drift

sync-version propagated /VERSION to resources/clojure-elisp/VERSION and
nothing else, while six locations restate the version. Measured on this branch
before the fix:

VERSION                     0.7.2
clojure-elisp-runtime.el    0.7.2   (stamped by compile-runtime at regen)
clojure-elisp-mode.el       0.7.1   <- drifted
cider-clojure-elisp.el      0.7.1   <- drifted

Historically those two sat at 0.5.0 while VERSION read 0.6.1 — two releases
behind, invisible because no gate looked at them, hand-fixed twice. MELPA
Stable reads that header, so drift ships the wrong version.

The fix

sync-version! stamps all three .el packages, and throws when a header is
absent
rather than writing nothing. That matters: the sync writes by regex, so
a renamed or restructured file would otherwise drop out of it silently — and
silence is exactly what let this last two releases.

Stamping the runtime header here too means a bump no longer needs a regen to
reach the shipped file. (I hit that trap myself in #26: regenerated before
bumping, and shipped a runtime naming the previous release.)

Two tests, both non-vacuous:

  • every .el header equals /VERSION — verified to fail when one is edited back
  • no .el in resources/clojure-elisp is missing from the list, so a new
    package cannot quietly keep whatever header it was born with

Also: a flake that kept masking runs

cross-file-warning-test passed (.getParent f1) — the shared system temp
directory — to compile-project, so it compiled every .cljel any other
process happened to leave in /tmp. It errored twice during this session and
passed on re-run, which is the worst kind of red: unreproducible locally,
intermittent in CI.

Proven rather than assumed. With one unparseable .cljel dropped in /tmp:

old code   ERROR ... Reader error at line 536: Unsupported escape character
new code   1 tests, 6 assertions, 0 failures

609 Clojure tests, 3063 assertions, 0 failures. 28 ERT tests, 0 unexpected.

sync-version propagated /VERSION to resources/clojure-elisp/VERSION and
nothing else, while six locations restate the version. The result:
clojure-elisp-mode.el and cider-clojure-elisp.el read 0.5.0 while
VERSION read 0.6.1 - two releases of drift, invisible because no gate
looked at them, and hand-fixed twice. MELPA Stable reads that header, so
drift ships the wrong version.

sync-version! now stamps all three .el packages and THROWS when a header
is missing, so a renamed or restructured file fails the release loudly
instead of dropping silently out of the sync - that silence is what let
the drift last two releases. Stamping the runtime header here too means
a bump no longer needs a regen to reach the shipped file.

version-consistency-test asserts all three against /VERSION, and a
second test fails if an .el appears in resources/clojure-elisp that is
in neither list, so a new package cannot quietly keep the header it was
born with.

Also fixes a flake that kept masking runs: cross-file-warning-test
passed (.getParent f1) - the shared /tmp - to compile-project, so it
compiled every .cljel any other process had left there. Reproduced by
dropping one unparseable .cljel in /tmp: errors before, passes after.

Closes 20260905161109-0e698b23, 20260713171046-5d818865 and
20260905173027-253109a0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant