about summary refs log tree commit diff
path: root/test/python
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-07 17:14:25 +0000
committerPjotr <wrk@bosa.lan>2026-11-07 17:14:25 +0000
commit9fa03035b9f21352c1c8b93681cc1bc1ce4cf6ff (patch)
treea59357b60f6fb3bd9ae20e1f7bf4d8c06ce8abae /test/python
parent18d18b1c125c06dd67dcf54ccbd89eb128643737 (diff)
downloadgenenetwork4-9fa03035b9f21352c1c8b93681cc1bc1ce4cf6ff.tar.gz
version: stamp the commit the binary was built from, and prove it
/version reported 4831e5a while HEAD had moved on to 18d18b1: the stamp
is written at build time and build.rs only declared .git/HEAD, which
keeps saying "ref: refs/heads/main" across commits, so a rebuild after a
commit reused the old hash. It now declares the ref file and the index
as well, which is what actually makes a rebuild re-stamp.

Three additions make the stamp trustworthy rather than merely newer:

- `-dirty` when the working tree had uncommitted changes at build time,
  so a binary built pre-commit can never claim to be that commit;
- `source_digest`, a hash over the compiled source files, which tells
  apart two builds of the same commit -- or of the same dirty tree --
  where a commit hash cannot;
- `branch`, so a detached HEAD is visible.

* build.rs: watch .git/HEAD, the ref it points at, and .git/index;
stamp dirty, digest and branch as well as the hash and commit date.
* src/lib.rs (VersionInfo): the three new fields, plus a note saying a
stamp is never advanced by committing without rebuilding.
Diffstat (limited to 'test/python')
0 files changed, 0 insertions, 0 deletions