Skip to content

fix(id): unknown build variant marker forces rebuild (#6883) - #7345

Merged
dezren39 merged 1 commit into
mainfrom
queue/fb-6883-variant-marker
Nov 11, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/fb-6883-variant-marker

Conversation

@dezren39

@dezren39 dezren39 commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Fix for issue #6883 (fallback claim by lane code-u; queue backend down, code#6619): pkgs/id/scripts/build.sh trusted the on-disk binary whenever the variant marker was missing, empty, or garbage — only an exact other-variant marker forced a rebuild — so a lib binary could silently pass as the web build (and vice versa) at the shared target/*/id path. The marker was also written non-atomically, which is how truncated markers are produced.

Changes:

  • Unknown marker state rebuilds. A missing marker, or a marker whose content is not exactly the requested variant, now forces a backend rebuild. Only an exact match for the requested variant may fall through to the timestamp up-to-date path.
  • Atomic marker write. The marker is written to a temp file in target/ and renamed over the marker file, so an interrupted build cannot leave an empty/truncated marker.
  • Regression tests in pkgs/id/scripts/build-sh-test.sh: missing-marker, empty-marker, and garbage-marker cases (build one variant, disturb the marker, request the other, assert cargo runs with the correct flags and the marker is rewritten), plus an exact-match control asserting an intact matching marker still takes the up-to-date path without invoking cargo.

Verification (laptop, stubbed-cargo fixture):

  • Post-fix: bash scripts/build-sh-test.sh — build-sh tests passed (all pre-existing lib debug/release, assets, and web control cases plus the four new cases).
  • Pre-fix control: the same test file against the original build.sh fails at the first new case — missing marker did not force a lib rebuild — confirming the new cases catch the filed bug.

Closes #6883


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

id(build.sh): a missing or corrupt variant file lets the wrong-variant binary pass as up to date — a lib binary is served for a web build (and vice versa)

1 participant