fix(nix): version untagged flake builds as devel+<short-sha> #118

Merged
pti merged 1 commit from fix/flake-devel-version into main 2026-11-02 13:16:32 +01:00
Owner

Flakes cannot see Git tags (self.sourceInfo has rev/shortRev/revCount, never the ref), so nix build without WRAPTOOL_VERSION stamped a fake 0.0.0-dev.

It now falls back to the same devel+<short-sha>[-dirty] identity internal/buildinfo gives a local go build, from self.rev or self.dirtyRev. Release builds are unchanged: they still pass the tag's version through WRAPTOOL_VERSION=… nix build --impure. docs/contributing.qmd now describes the new fallback.

Verified:

  • dirty tree: nix eval .#packages.x86_64-linux.default.version → "devel+8cffb8c63ff1-dirty"
  • clean commit (scratch clone): nix build → binary prints wraptool version devel+8a24b7b9b247

🤖 Generated with Claude Code

Flakes cannot see Git tags (`self.sourceInfo` has `rev`/`shortRev`/`revCount`, never the ref), so `nix build` without `WRAPTOOL_VERSION` stamped a fake `0.0.0-dev`. It now falls back to the same `devel+<short-sha>[-dirty]` identity `internal/buildinfo` gives a local `go build`, from `self.rev` or `self.dirtyRev`. Release builds are unchanged: they still pass the tag's version through `WRAPTOOL_VERSION=… nix build --impure`. `docs/contributing.qmd` now describes the new fallback. Verified: - dirty tree: `nix eval .#packages.x86_64-linux.default.version` → `"devel+8cffb8c63ff1-dirty"` - clean commit (scratch clone): `nix build` → binary prints `wraptool version devel+8a24b7b9b247` 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(nix): version untagged flake builds as devel+<short-sha>
All checks were successful
Lint / lint (pull_request) Successful in 1m33s
Lint / sonarqube (pull_request) Has been skipped
358f0b8435
Flakes cannot see Git tags, so the package fell back to a fake
0.0.0-dev version. Without WRAPTOOL_VERSION it now reports the same
devel+<short-sha>[-dirty] identity internal/buildinfo gives a local
go build, taken from self.rev or self.dirtyRev, so every Nix build
names its exact commit. Release builds still pass the tag's version
through WRAPTOOL_VERSION.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pti merged commit cb8e9b40e8 into main 2026-11-02 13:16:32 +01:00
pti deleted branch fix/flake-devel-version 2026-11-02 13:16:32 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pti/wraptool!118
No description provided.