Repository navigation
fix(build): ignore thirdparties scratch trees in native provenance checks (#30235) - #30592
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
…ecks (matrixorigin#30235) A clean checkout could not complete its first native build: native libraries compiled successfully, then the provenance record step failed with "native inputs changed while the build was running". cgo/mo-native-provenance classifies native *inputs* with `git status --porcelain --untracked-files=all -- Makefile cgo thirdparties` at prepare/begin/record/verify time. The thirdparties Makefile extracts and compiles inside scratch trees (_croaring_build, _fp16, _jemalloc_build, _simsimd, _stringzilla, _usearch_build, _xxhash_build) that are recreated from the tracked tarballs on demand, so their contents are never inputs. Unlike the historical versioned extraction trees (SimSIMD-*, StringZilla-*, ...), these underscore names were never added to .gitignore, so a scratch tree left behind by an in-flight, interrupted, or otherwise incomplete cleanup misjudged the build as having user-edited inputs. Ignore the seven scratch trees, mirroring the existing install/* and versioned-tree rules, and pin the contract with a regression test that runs git check-ignore over each scratch directory so a future Makefile scratch-tree rename cannot silently reintroduce matrixorigin#30235. Verified: with all seven scratch trees populated, `git status --porcelain --untracked-files=all -- Makefile cgo thirdparties` is empty and `mo-native-provenance prepare` classifies the build as reusable=yes; a genuine untracked file or a tracked edit under thirdparties/ still makes the same status non-empty and the build local-only (reusable=no).
8447e33 to
547dcb7
Compare
|
Previous head Read of the race report (run 39229510831, job 117983861528): it triggers only on that test's timeout path — after Local evidence at this head: Rebased onto |
|
mo-bot review · Commit: Review completed. Read the assessment. |
|
mo-bot review · Commit: "interrupted" |
XuPeng-SH
left a comment
There was a problem hiding this comment.
mo-bot review · mo-bot-local · review
Commit: 547dcb77351810ae53b23aa95a067eac99a4d615
Assessment: approve
Reviewed the complete two-file delta and its build/provenance callers. The seven ignore rules correctly classify generated scratch trees through the existing Git policy, preserving genuine-input and artifact-integrity checks without duplicating logic. No actionable defects or SQL runtime costs were identified.
Model: gpt-6-astra / xhigh
Session: 01a13dcf-1517-7f90-b3f9-c5f9f9e7031b · slot 0 · generation 1
Validation:
-
Isolation preflight passed. TestNativeBuildScratchDirsStayIgnored executed through test-exec and passed; focused.jsonl matches receipt checks/1792411185698855350-3.json.
-
The actual provenance script reproduced the failure with base ignore rules, then passed prepare/begin/record/verify and reuse with the new rules. Tracked edits, unrelated files, lookalike directories and artifact corruption remained rejected. protocol.log and protocol-details.json match receipt checks/1792411236663607823-4.json.
-
Both check receipts identify the assigned HEAD with an empty source delta. Diagnostic native inputs were matched against 191 source files; source remained unchanged.
-
Supplied exact-head CI reports successful shared build, Ubuntu unit tests, arm64 checks and multi-CN BVTs. The previous-head fileservice race concern affects unchanged code.
-
Evidence associations, input fingerprints and artifact hashes are retained in /home/xupeng/.local/state/mo-bot/jobs/eb618b69d9ceb4ff30b5165f/attempt-1/review-audit.json.
Limitations:
-
The local provenance check used stub artifact bytes; it validates classification and lifecycle behavior, not native compilation.
-
Raw CI logs and the standalone linked issue body were not supplied. CI conclusions and the issue contract were assessed from the frozen evidence.
Merge Queue Status
This pull request spent 5 hours 37 minutes 44 seconds in the queue, including 53 minutes 33 seconds running CI. Required conditions to merge
|
What type of PR is this?
Which issue(s) this PR fixes:
issue #30235
What this PR does / why we need it:
A clean checkout could not complete its first native build: native libraries compiled successfully, then the provenance
recordstep failed withnative inputs changed while the build was running(Makefile:367).Root cause:
cgo/mo-native-provenanceclassifies native inputs withgit status --porcelain --untracked-files=all -- Makefile cgo thirdpartiesatprepare/begin/record/verifytime. The thirdparties Makefile extracts and compiles inside scratch trees (_croaring_build,_fp16,_jemalloc_build,_simsimd,_stringzilla,_usearch_build,_xxhash_build) that are recreated from the tracked tarballs on demand — their contents are build outputs, never inputs. The historical versioned extraction trees (SimSIMD-*,StringZilla-*,fp16,usearch-*,install) were added to.gitignorein #21476 for exactly this reason, but the Makefile later switched to underscore scratch names and.gitignorewas never updated. Any scratch tree left behind — by an in-flight build atrecordtime, an interruptedmake, or an exited recipe — therefore misjudged the build as having user-edited inputs, failing a genuinely clean first build.Fix, mirroring the established pattern: ignore the seven scratch trees. Genuine input changes must still be detected, and they are: a modified tracked file or any non-scratch untracked file under
Makefile/cgo/thirdpartiesstill makes the samegit statusnon-empty (verified locally), demoting the build to local-only (reusable=no).Tests:
TestNativeBuildScratchDirsStayIgnored(optools, runs undergo test ./optools/): runsgit check-ignoreover each of the seven scratch directories so a future Makefile scratch-tree rename cannot silently reintroduce the failure. Verified it fails when a rule is removed and passes with the fix.go test ./optools/suite passes.git status --porcelain --untracked-files=all -- Makefile cgo thirdpartiesis empty and./cgo/mo-native-provenance prepareclassifies the build asrebuild-all+reusable=yes; with a genuine untrackedthirdparties/scratch-note.txtadded, the status lists it andpreparereturnsreusable=no— real input changes are still detected.