You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
inject-build-id.py — replaces the __build__ placeholder in src/crossbar/_version.py with $CROSSBAR_BUILD_ID
tox.ini.orig — the only caller (python inject-build-id.py), and it is
disabled (.orig)
Nothing in the current justfile, pyproject.toml (hatch), or GitHub Actions
invokes any of these (confirmed: zero references). It was a build-time
injection (transient, in the build env — never committed, not tied to PyPI
publish).
inject-build-id.py is also stale and buggy:
it searches for __build__ = '00000000-0000000' (single quotes, 00000000),
but _version.py now has __build__ = "19000101-0000000" (double quotes, 19000101) — no match;
if contents.find(_SEARCH): is wrong — str.find returns -1 (truthy) when
not found, so the replace path runs even on no-match and falsely reports "Ok".
Proposed fix
Re-wire build-ID stamping into the current build, as a build-time injection
(do NOT commit the stamped value):
Inject it into src/crossbar/_version.py's __build__ immediately before the
wheel/sdist build, in the just dist / just build recipe and/or the main.yml "Build Distribution Packages" job (so the published artifact -
which flows through the chain-of-custody verified upload/download - carries
the real build ID).
Replace the broken inject-build-id.py with either a fixed version (correct
search string incl. double quotes, robust to current placeholder; fix the find() bug) or a small sed in the recipe. Prefer a single, simple,
well-tested approach.
Clean up the orphans no longer needed (tox.ini.orig, and versions.sh / inject-build-id.py if folded into the recipe).
Reproducibility: the date+shortsha scheme is deterministic per commit
(date is build-day). If fully reproducible builds are desired later, the build
ID could be derived from the commit date instead of the wall clock — out of
scope here.
Local/dev builds: when CROSSBAR_BUILD_ID is unset (plain just install),
keep the placeholder (current behavior) — only stamp in CI release builds.
Acceptance
A release/nightly artifact's crossbar version shows a real YYYYMMDD-<shortsha> build ID, not 19000101-0000000.
Local just install still works with the placeholder (no hard dependency on
the env var).
A small test covering the injection (placeholder present → replaced when env
var set; left intact when unset).
Note: This work was completed with AI assistance (Claude Code).
Checklist
I have searched existing issues to avoid duplicates
Problem
crossbar versionshows a build ID next to the version:[19000101-0000000]is a placeholder that is never replaced — so releasedartifacts ship with this dummy build ID.
See:
The stamping mechanism still exists in the tree but is orphaned / dead, left
behind by the tox → justfile+uv/hatch modernization:
versions.sh— setsCROSSBAR_BUILD_ID=$(date --utc +%Y%m%d)-$(git rev-parse --short HEAD)inject-build-id.py— replaces the__build__placeholder insrc/crossbar/_version.pywith$CROSSBAR_BUILD_IDtox.ini.orig— the only caller (python inject-build-id.py), and it isdisabled (
.orig)Nothing in the current
justfile,pyproject.toml(hatch), or GitHub Actionsinvokes any of these (confirmed: zero references). It was a build-time
injection (transient, in the build env — never committed, not tied to PyPI
publish).
inject-build-id.pyis also stale and buggy:__build__ = '00000000-0000000'(single quotes,00000000),but
_version.pynow has__build__ = "19000101-0000000"(double quotes,19000101) — no match;if contents.find(_SEARCH):is wrong —str.findreturns-1(truthy) whennot found, so the replace path runs even on no-match and falsely reports "Ok".
Proposed fix
Re-wire build-ID stamping into the current build, as a build-time injection
(do NOT commit the stamped value):
CROSSBAR_BUILD_IDas$(date -u +%Y%m%d)-$(git rev-parse --short HEAD)(e.g.
20260621-bc6337c).src/crossbar/_version.py's__build__immediately before thewheel/sdist build, in the
just dist/just buildrecipe and/or themain.yml"Build Distribution Packages" job (so the published artifact -which flows through the chain-of-custody verified upload/download - carries
the real build ID).
inject-build-id.pywith either a fixed version (correctsearch string incl. double quotes, robust to current placeholder; fix the
find()bug) or a smallsedin the recipe. Prefer a single, simple,well-tested approach.
tox.ini.orig, andversions.sh/inject-build-id.pyif folded into the recipe).Notes / considerations
(
main.ymlbuild job), so the verified artifact published to PyPI has thestamped ID. Don't stamp in
release.yml(it now downloads the already-builtartifact, per 26.6.1 follow-ups: fix
release.ymlartifact download path + add per-release codenames #2227).(date is build-day). If fully reproducible builds are desired later, the build
ID could be derived from the commit date instead of the wall clock — out of
scope here.
CROSSBAR_BUILD_IDis unset (plainjust install),keep the placeholder (current behavior) — only stamp in CI release builds.
Acceptance
crossbar versionshows a realYYYYMMDD-<shortsha>build ID, not19000101-0000000.just installstill works with the placeholder (no hard dependency onthe env var).
var set; left intact when unset).
Note: This work was completed with AI assistance (Claude Code).
Checklist