Repository navigation
Say that a git-derived version stamp is lost unless stamped - #50
Open
anakanemison wants to merge 1 commit into
Open
anakanemison wants to merge 1 commit into
anakanemison wants to merge 1 commit into
Conversation
A project that derives its version from the repository at configure or build time (git describe, a commit hash, a build date) loses it under Bazel unless the migration wires it through workspace status: a genrule cannot see .git from the sandbox, the generator still runs on both sides, and the output has the same shape, so the action graph cannot tell. Measured in any2bazel-lab: both OpenTTD migrations, with and without the skill, produced a binary reporting "norev0000", "unknown" and 1970, the project's own fallbacks for "no git information", while reporting success; the skill-guided one printed CONVERGED errors=0 warnings=0. Other migrations kept the version (a Bitcoin Core one through --workspace_status_command and a stamp = 1 genrule, as did a pono one), so it is not a capability gap: nothing in the procedure asks for it. Adds one paragraph to "Create initial BUILD.bazel files": the failure mode and the Bazel mechanism that preserves the value. The byte comparison that catches its absence is the one the convergence-boundary list already asks for on every generated file. In the lab's later OpenTTD run with this change, the binary reported the revision, through --workspace_status_command. Lab-Proposal: P19 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Part 15 of 23 of a stacked series (tracking issue: #35). Based on
U14-configure-step-strategies, the previous part: review and merge that first.Kind: guidance. Lab proposal: P19.
What the migration runs showed
openttd's migrated binary reported
norev0000and an unknown version. With this guidance it carries the revision through--workspace_status_command(run 085).The change
A project that derives its version from the repository at configure or
build time (git describe, a commit hash, a build date) loses it under
Bazel unless the migration wires it through workspace status: a genrule
cannot see .git from the sandbox, the generator still runs on both sides,
and the output has the same shape, so the action graph cannot tell.
Measured in any2bazel-lab: both OpenTTD migrations, with
and without the skill, produced a binary reporting "norev0000", "unknown"
and 1970, the project's own fallbacks for "no git information", while
reporting success; the skill-guided one printed CONVERGED errors=0
warnings=0. Other migrations kept the version (a Bitcoin Core one through
--workspace_status_command and a stamp = 1 genrule, as did a pono one), so
it is not a capability gap: nothing in the procedure asks for it.
Adds one paragraph to "Create initial BUILD.bazel files": the failure mode
and the Bazel mechanism that preserves the value. The byte comparison that
catches its absence is the one the convergence-boundary list already asks
for on every generated file.
In the lab's later OpenTTD run with this change, the binary reported the
revision, through --workspace_status_command.
Testing
pytest tests/at this commit: 196 passed (130 onmain).🤖 Generated with Claude Code