feat: Task 107 -- build version embedding (cargo, CI, Nix)#350
Merged
Conversation
The About modal showed 'Build unknown' and CI-distributed builds reported '(unknown)' to fastfetch. Root cause across all surfaces: VERGEN_GIT_DESCRIBE resolving to "unknown". Three independent build paths each produced it: - 107.1 cargo: build.rs had no rerun trigger tied to git state, so the git-describe value cached and went stale. Add rerun-if-changed for HEAD, packed-refs, and refs (resolved via git rev-parse --git-path, worktree-safe). - 107.2 CI: deploy.yaml build checkouts used a shallow, tagless clone, so git describe --tags failed. Add fetch-depth: 0 + fetch-tags: true to all four build jobs (release job needs no checkout). - 107.3 Nix: cleanSource strips .git and the sandbox is git-less. build.rs now honours a pre-set VERGEN_GIT_DESCRIBE verbatim (git fallback otherwise); flake.nix supplies it from self.shortRev/dirtyShortRev.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task 107 — Build Version Embedding (v0.9.0)
Closes the
Build unknown/ fastfetch(unknown)version gaps (PLANNING #7, #8).Root cause
The About modal and
TERM_PROGRAM_VERSION(what fastfetch reads) both surfaceVERGEN_GIT_DESCRIBE. The vergen +git describeinfrastructure alreadyexisted; the bug was that the describe value resolved to
"unknown"on threeindependent build paths, each for a different reason.
Fixes
build.rshad onlyrerun-if-changed=build.rs, no triggertied to git state, so the describe value cached and went stale (could stick at
"unknown"). Addsrerun-if-changedforHEAD,packed-refs, andrefs,resolved via
git rev-parse --git-path(correct in worktrees/submodules).deploy.yaml's four build-job checkoutsused a shallow, tagless clone, so
git describe --tagsfailed. Addsfetch-depth: 0+fetch-tags: true(mirroring the already-correctnightly.yml). Thereleasejob downloads artifacts only and needs no change.cleanSourcestrips.gitandthe build sandbox is git-less, so the in-build
git describecan neversucceed — and this is the NixOS install path.
build.rsnow honours a pre-setVERGEN_GIT_DESCRIBEenv var verbatim (git shell-out remains the fallback);flake.nixsupplies it fromself.shortRev or self.dirtyShortRev or "nix".Also bumps the workspace version to
0.9.0-beta.6.Verification
cargo clippy --all-targets --all-features -- -D warnings— cleancargo test --all— all passcargo machete— cleancargo fmt --all -- --check— cleannixfmt/statix check/deadnix --failonflake.nix— cleannix build .#freminal— wrapped binary embedsBuild v0.9.0-beta.6-<rev>-dirtyandTERM_PROGRAM_VERSION = "0.9.0-beta.6 (v0.9.0-beta.6-<rev>-dirty)"; no(unknown)skipped; env var absent → git fallback
Plan:
Documents/PLAN_VERSION_090.md(Task 107, marked Complete).