Repository navigation
fix(archive): pin deterministic ar output; fix the #2203 parity test's unit↔object pairing - #2204
Merged
Merged
Conversation
…iring main is red at b47e4cf: prebuilt_core::tests:: a_served_tree_and_a_source_build_archive_to_identical_bytes failed on the post-merge push run (job 140904430000) while passing in its own merge group (job 140897516020, same workflow and runner label). Root cause was in the test added by #2203, not in the product: it wrote one object per framework unit, then sorted the object PATHS and zipped that sorted list against the UNSORTED unit list. The publisher manifest therefore mapped a unit to the other unit's object whenever the object-hash order differed from the unit order, so the served arm archived swapped bytes. Reproduced locally at 2/3 full-suite runs; the new member-level assertion named it (unit_4425.cpp.o carried "compiled object 1" in one arm and "compiled object 0" in the other). Pairs are now sorted together, and the suite is 30/30 green (284 passed, 0 failed). The parity claim also needs the archive bytes to be a property of fbuild rather than of the host archiver's build options, so fbuild_core::archive:: create now passes `D` (uid/gid/mtime zeroed) and falls back once to plain `rcs` for an archiver that rejects the modifier (cctools/older vendor ar). The test now compares the full member table (name, mode, uid, gid, mtime, payload) before the digest, so a future failure names the diverging field instead of printing two hashes. #2196 stays open.
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.
Why
mainis redPost-merge push run 46120703055 (
b47e4cf3), jobglibc 2.17 floor / Check (ubuntu-latest)= 140904430000:The same test passed in that commit's own merge group (job 140897516020,
... ok, 284 passed / 0 failed at 07:10Z) — same workflow, sameubuntu-latestpool label. Not a lane difference: the test itself was flaky.Root cause (in the test added by #2203, not in the product)
prebuilt_core_tests.rswrote one object per framework unit into the fresh core build dir, collectedfresh_objects, sort()ed the paths, and then built the publisher manifest withunits.iter().zip(&names)— pairing the sorted object list back against the unsorted unit list.CompilerBase::object_pathnames objects from a hash of the source path, so whenever the hash order differed from the unit order the manifest mapped a unit to the other unit's object: the served arm then archived swapped bytes.Reproduced locally at 2 of 3 full-suite runs. The first version of the new assertion made the cause explicit:
Fix: build
(unit, object)pairs, sort the pairs together, and derive both the archive member list and the manifest from that one sorted vector. (Also fixed while diagnosing: the member parser now skips the 8-byte!<arch>\nglobal header — without it it returned empty lists and the comparison was vacuous.)Second half: make the claim host-independent
#2196's acceptance sentence is "a served tree and a from-source build archive to identical bytes".
fbuild_core::archive::createinherited whatever determinism default the hostarwas built with;Dmakes it explicit (uid/gid/mtime written as zero), so the archive bytes are a property of fbuild rather than of the distro's binutils configuration. An archiver that rejectsDfalls back to plainrcsonce — losing byte parity must never lose a build. Failure classification (disk-full vs archiver error, #1750 item 4) is unchanged and now lives inarchiver_failure.Tests (real output)
soldr cargo test -p fbuild-core --lib archive→ 15 passed; 0 failed (6 new archive tests + 9 filtered-in by name).soldr cargo test -p fbuild-build-esp --lib prebuilt_core→ 12 passed; 0 failed.fbuild-build-esplib suite, 30 consecutive runs:284 passed; 0 failed; 7 ignoredevery time. Pre-fix the same loop failed 2 of 3.MODIFIERSreverted to"rcs"→the_archiver_is_asked_for_deterministic_outputFAILED (6 passed; 1 failed, exit 101); fallback branch deleted →an_archiver_that_rejects_d_still_archivesFAILED (6 passed; 1 failed, exit 101). Both restored (touch, suite green).soldr cargo fmt --check -p fbuild-core -p fbuild-build-espexit 0;ci/enforce_platform_boundary.py --print-totals→rows=0; dylint_rows=0.Local
clippy/dylintwere not obtainable this hour (build-lease); CI'sDylint Fullis the gate.#2196 stays open (its cold/warm bench hook is untouched).