pxx --version prints no build identity
Why run time, not build time
A binary cannot contain its own hash. A source commit embedded at build time
would make the binary's bytes depend on git state, so selfcheck.sh, which
rebuilds a bundle's binaries from the tarball where there is no .git, would
stop reproducing MANIFEST.sha256. So the compiler hashes /proc/self/exe
(SHA-256, in compiler.pas) and looks for that hash in records that already
name binaries by hash:
| Where | Record | Prints |
|---|---|---|
| release bundle | MANIFEST.sha256, then RELEASE-ID |
release: tag "codename", source:, and pin: when the release binary is the pin |
| checkout | stable_linux_amd64/default/pin.log |
pin: vNNN, source: the commit the pin was cut from |
| checkout | compiler/.pascal26.fixedpoint |
local: the last make, and its source hash |
| anywhere else | none | local: not a pin or a release binary |
A line is printed only when a record names the hash. A VERSION file that happens to sit nearby does not count.
tools/release.sh's build_dist now writes RELEASE-ID (tag, codename,
source commit, and pin only when the release binary is the pinned one). The
bundle's RELEASE.md lists it.
Measured (2026-09-29, fixedpoint d67ea56f34a7)
- The
build:value equalssha256sum's first 12 digits for the binary with 0 to 63 extra bytes appended, which covers every padding case of the last block (64 of 64). - A bundle made by the real
build_dist(x86_64 only), then extracted fresh:compiler/pxx-x86_64 --versionandcompiler/pascal26 --versionboth printrelease: v0.1.0-beta.2 "Blaise"andsource: ab6ab895b9bc. There is nopin:line, correctly, since that binary is not the pin. - Checkout: a
pin.logline in the real format that names the binary givespin: v452andsource:, whether the binary sits instable_linux_amd64/default/or incompiler/. Themakebuild giveslocal:with the stamp's source hash. A copy with no record giveslocal: not a pin or a release binary. --versiontakes about 0.5 s on this 8.8 MB binary, because of the hash.- A Makefile row checks the
build:line of both flags againstsha256sum. The v451 pinned binary fails it. - docs: reporting-bugs.md, release-notes/index.md and cli.md now ask for
--version. They keep thesha256sumline for the v0.1.0-beta.1 archive, whose binary predates this change.