Repository navigation
test(prebuilt): prove served and from-source builds archive the same bytes (#2196) - #2203
Merged
Merged
Conversation
…bytes The last named acceptance cell of #2196: a served-tree build and a from-source build of one cell must produce a byte-identical framework archive, asserted on the artifact (SHA-256 + bytes) rather than on entry names -- the #2192 rule. The test drives both arms through the real primitives: objects written at this host's own CompilerBase::object_path, archived with the shared fbuild_core::archive::create (60 s library watchdog), packed by prebuilt::pack, extracted and hydrated into a *different* build dir, then archived again. Additive only: one helper plus one test, no production code.
This was referenced Nov 28, 2026
Merged
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.
What
The last named acceptance cell of #2196: a served-tree build and a from-source build of the same cell must produce a byte-identical framework archive.
prebuilt_core_tests.rsgains one end-to-end parity test that goes through the real publisher and the real hydration rule rather than comparing names:CompilerBase::object_pathinside one core build dir and archives them with the sharedfbuild_core::archive::createprimitive (the same one the library stage uses, 60 s watchdog included);prebuilt::pack(so the tree carriesobjects.json), the clientextracts it,hydrates into a different build dir, and archives what it received;assert_eq!(fresh, reused)on the bytes, plusassert_ne!on the two build dirs so the test cannot pass by archiving one directory twice.This is the
#2192rule applied to the archive itself: a marker that only recordedsize_bytesonce made a reused tree report a compressed size while a fresh extraction reported content bytes. Entry names alone cannot catch that class of drift.Why now
#2199(cell 3) proved hydration lands the publisher's object at this host's path, and#2201(cell 3b) proved a packed tree is hydratable through the real extractor — but nothing onmainasserts that the archive a build actually links is the same artifact either way.aris deterministic (GNU binutils defaults toD) and hydration copies bytes verbatim, so the property holds today; this test pins it so a future hydration change (a permission fix, a re-hash, a re-link) cannot silently make a served build link a different archive.Verification (real output)
soldr cargo fmt --check→ exit 0 (soldr reported the cached verdict for identical inputs).ci/enforce_platform_boundary.py --print-totals→rows=0; dylint_rows=0.b"tampered object"before the second archive → exit 101, exactly one failure:assertion left == right failed: a served build and a from-source build of one cell must hash the same archive(11 passed, 1 failed). Tamper removed, file restored + touched, re-run green above.
Additive only: one test helper plus one test in an existing
_tests.rs; no production code, no new crate, no workflow change.#2196 stays open (its remaining cell is the #1882 decision-6 cold/warm hook).