Commit 8110548
Closes the five-site `0.1.0` drift documented in #297: the compiler
binary's `--version`, REPL banner, LSP `initialize` response, and the
ONNX `m_producer_version` field were all hand-edited to "0.1.0" and
never bumped when v0.1.1 was tagged, so the v0.1.1 binary still
reported "0.1.0" (caught during the #282/#295 shim smoke).
Approach: option (1) from #297 — generated `Version` module + CI
substitution. One small module + one small workflow step; no
runtime dependency on `dune-build-info` or any new opam package.
Source-of-truth single file
---------------------------
lib/version.ml new — `let value = "0.1.1"`, 1 string,
baked from the tag at release time
Five sites collapsed onto it
----------------------------
bin/main.ml `let version = Affinescript.Version.value`
lib/repl.ml `Printf.printf "AffineScript REPL v%s\n"
Version.value`
lib/lsp_server.ml `("version", `String Version.value)`
lib/onnx_codegen.ml `m_producer_version = Version.value`
dune-project `(version 0.1.1)` (matches the latest release;
opam metadata regenerated)
lib/dune `version` added to the modules list
Release pipeline bake step
--------------------------
`.github/workflows/release.yml`: new step between `Install
dependencies` and `Build release` that rewrites BOTH `lib/version.ml`
and `dune-project` from `${GITHUB_REF_NAME#v}` (stripping the leading
`v`) before `dune build --release`. Subsequent tag bumps need no
hand-edit — cut a `vX.Y.Z` tag and the binary self-reports `X.Y.Z`.
Cross-checked locally
---------------------
$ opam exec -- dune build --release
(clean, no warnings introduced)
$ _build/default/bin/main.exe --version
0.1.1
$ grep '^version' affinescript.opam # 0.1.1
$ grep '^let value' lib/version.ml # 0.1.1
$ grep '^(version' .build/dune-project # 0.1.1
All four sites coherent.
Closes #297. Refs #282 (the closure-PR smoke that surfaced the drift).
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2f0f27f commit 8110548
9 files changed
Lines changed: 43 additions & 8 deletions
File tree
- .build
- .github/workflows
- bin
- lib
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
72 | 86 | | |
73 | 87 | | |
74 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
313 | 313 | | |
314 | 314 | | |
315 | 315 | | |
316 | | - | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
| 233 | + | |
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
297 | 297 | | |
298 | 298 | | |
299 | 299 | | |
300 | | - | |
| 300 | + | |
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
0 commit comments