build: ldflags version stamp cannot be invalidated by task build's source checksum #1509

Closed
opened 2026-10-27 13:40:41 +00:00 by sam · 0 comments
Owner

Split out of archie-core-hhgw (which fixes the ui/dist sources gap). The build task's version stamps are not an input to Task's up-to-date check:

GATEWAY_VERSION / RUNTIME_VERSION (Taskfile.yml:349-353) are computed by git describe --tags --match ... and passed as -X ldflags. Task's sources: check is a content checksum over files, so it cannot see HEAD movement or a new tag when no file content changed.

Measured on the cp-taskfile worktree at f600eb01 (2026-09-22):

describe at HEAD 1.30.0-97-gf600eb01
git commit --allow-empty 1.30.0-98-g0ebf5921 (0 lines of file diff)
task build 'Task "build" is up to date'
bin/archied contains 98-g... 0
bin/archied contains 97-g... 4 <- stale stamp shipped

Why it is not expressible as a sources entry:

  • git describe is a function of the commit graph and the tag set, not of any tracked file's content (the empty commit above changed it with zero content change).
  • Naming git metadata as a source does not work here: in a worktree .git is a FILE (gitdir: .../worktrees/), so .git/HEAD and .git/refs/** do not exist as paths; the gitdir and packed-refs live in the shared common dir outside the worktree (verified here: .git/refs/tags -> 'Not a directory', refs in /work/apps/archie-core/.git). A sources glob that matches zero files is silently ignored by Task (verified in an isolated task: no warning, no error), so such an entry would look like a fix and do nothing.
  • Even in the main checkout, .git/HEAD is a symref whose content ('ref: refs/heads/x') does not change on commit, and hashing .git/** would invalidate on index/log churn.

What a real fix needs (design decision, not a one-line change): the only in-Task hook for a non-file input is status:, e.g. persist the describe output next to the binaries during the build and test "$(git describe ...)" = "$(cat <stamp>)" on the next run. That adds a persisted artifact and deliberately re-links on every HEAD movement (including commits that touch no Go file), so it changes the build task's caching contract and needs its own before/after evidence. Related but distinct from archie-core-k94o (installer-side per-binary version skew detection).

Close reason

Fixed in 36118f4e: source builds stamp dev and CI owns the release stamp, so the build cache no longer depends on the commit graph.


Imported from beads archie-core-pdq2 · GitHub #1132 · type bug · priority P2 · created 2026-09-21 · closed 2026-09-26

Split out of archie-core-hhgw (which fixes the ui/dist sources gap). The build task's version stamps are not an input to Task's up-to-date check: GATEWAY_VERSION / RUNTIME_VERSION (Taskfile.yml:349-353) are computed by `git describe --tags --match ...` and passed as -X ldflags. Task's `sources:` check is a content checksum over files, so it cannot see HEAD movement or a new tag when no file content changed. Measured on the cp-taskfile worktree at f600eb01 (2026-09-22): describe at HEAD 1.30.0-97-gf600eb01 git commit --allow-empty 1.30.0-98-g0ebf5921 (0 lines of file diff) task build 'Task "build" is up to date' bin/archied contains 98-g... 0 bin/archied contains 97-g... 4 <- stale stamp shipped Why it is not expressible as a sources entry: - git describe is a function of the commit graph and the tag set, not of any tracked file's content (the empty commit above changed it with zero content change). - Naming git metadata as a source does not work here: in a worktree .git is a FILE (gitdir: .../worktrees/<name>), so .git/HEAD and .git/refs/** do not exist as paths; the gitdir and packed-refs live in the shared common dir outside the worktree (verified here: .git/refs/tags -> 'Not a directory', refs in /work/apps/archie-core/.git). A sources glob that matches zero files is silently ignored by Task (verified in an isolated task: no warning, no error), so such an entry would look like a fix and do nothing. - Even in the main checkout, .git/HEAD is a symref whose content ('ref: refs/heads/x') does not change on commit, and hashing .git/** would invalidate on index/log churn. What a real fix needs (design decision, not a one-line change): the only in-Task hook for a non-file input is `status:`, e.g. persist the describe output next to the binaries during the build and `test "$(git describe ...)" = "$(cat <stamp>)"` on the next run. That adds a persisted artifact and deliberately re-links on every HEAD movement (including commits that touch no Go file), so it changes the build task's caching contract and needs its own before/after evidence. Related but distinct from archie-core-k94o (installer-side per-binary version skew detection). ### Close reason Fixed in 36118f4e: source builds stamp dev and CI owns the release stamp, so the build cache no longer depends on the commit graph. --- _Imported from beads `archie-core-pdq2` · GitHub #1132 · type bug · priority P2 · created 2026-09-21 · closed 2026-09-26_
sam added the mediumbug labels 2026-10-27 13:40:41 +00:00
sam self-assigned this 2026-10-27 13:40:41 +00:00
sam closed this issue 2026-10-27 13:40:41 +00:00
sam added a new dependency 2026-10-27 13:42:25 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#1509