Skip to content

Say that a git-derived version stamp is lost unless stamped - #50

Open
anakanemison wants to merge 1 commit into
mschaller/u14-configure-step-strategiesfrom
mschaller/u15-version-stamp
Open

anakanemison wants to merge 1 commit into
mschaller/u14-configure-step-strategiesfrom
mschaller/u15-version-stamp

Conversation

@anakanemison

Copy link
Copy Markdown

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 norev0000 and 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 on main).

🤖 Generated with Claude Code

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant