Repository navigation
fix(policy): bind cached build scripts to the current worktree - #7321
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedThe included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits. Next included review available in 4 minutes. View limit details
Comment |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm sister files tools/repo-policy/src/source_identity.rs and the build.rs comment about stale rerun watches were not touched, but their behavior now depends on the live CARGO_MANIFEST_DIR rather than a baked path; no other build.rs or test sibling consumes a relocated env.
Evidence gaps
- ast-grep structural scan returned ok but produced no findings/matches referencing the new 307-line test or modified build.rs; route-truth confirmation is absent from receipt.
- Model proof intent was rejected by deterministic validation.
Independent final review: REVIEW_READYReviewer: /root/diagnose_shared_target_freshness. Exact head 19b96c3, tree d5a0135bc85591090ff240abb6ee2e120e17ee23, parent 56eaf73. All four paths, production identity consumers, actual-source A/B regression, process containment, both behavioral mutants, scoped allowance and changelog inspected. No material findings. The correct hashing owner is tools/repo-policy/source_identity.rs, unchanged. Absolute rerun watches, SHA256 hashing, compiler binding and fail-closed runtime guards remain intact. Only the production build-script manifest root changes to runtime lookup. Existing sibling test harnesses retain compile-time paths; the regression deliberately recompiles B's harness without changing watched source mtimes. This is not a global relocation or concurrent shared-target claim. Required run 38114014440 succeeded. Fresh hashed evidence and logs bind checkout dcc34ad to this head and base 8a2e358. 14,267 executed tests passed plus two reported Nextest skips; two doctests passed, one ignored. All 49 helper tests passed, including the new worktree regression. Required policy, check, strict Clippy, goldens, fixtures, verdict, PR evidence and final aggregate succeeded. The advisory review's partial workspace test and deferred focused requests are not additional complete proof. Its 900-second workspace and 300-second xtask timeouts, version-specific file cap and version-only ast-grep call are recorded separately in #5090, with existing upstream owners. They do not reveal a source defect. Native merge-tree against current main 2190c9a exits zero and retains both routing and worktree-test allowances. That later combined tree was not executed; the exact-head hosted integration passed on its recorded basis, and inspection found no changed semantic prerequisite requiring restack. Scope remains Linux/Cargo 1.95; Windows, arbitrary preserved-mtime edits and whole-CI savings are not claimed. Normal GitHub checks and protections remain enforced. |
Scope
Fixes #7318, a focused follow-up to #7158 and #5090. Read CARGO_MANIFEST_DIR from the running build script's environment rather than baking a checkout path into its cacheable executable. Preserve absolute rerun watches, source digest, compiler identity and fail-closed receipt semantics. No dependency, workflow or guard relaxation.
Exact candidate
Published head: 19b96c3.
Tree: d5a0135bc85591090ff240abb6ee2e120e17ee23.
Parent: 56eaf73.
Independently reviewed local equivalent: 5f3380743bcd507147c684553a3d18728e086931, identical tree.
Four paths: production build.rs, actual-source worktree regression, exact count-two test process allowance and changelog fragment.
Root cause and test
Cargo can reuse a build-script executable across relocated checkouts. Its synthesized CARGO_MANIFEST_DIR is not a tracked compile-time environment dependency. The script may run in B while its env! root still points at A. The source guard correctly rejects the stale result.
Regression copies the actual production build.rs/source_identity.rs into a minimal SHA256 fixture. Build A, backdate B's distinct identity-bearing sources, then invoke B through Cargo's selected executable and freshly compiled integration harness while reusing only the fixture-owned serialized target. Verify B's source/compiler stamp and all absolute B watches. Remove only the fixture-owned selected harness output to force its rebuild without touching watched source mtimes. The retained compile-time-root mutant fails behaviorally after successful B compilation. A relative-watch mutant also fails, establishing why absolute watches must stay. Missing runtime manifest environment fails clearly.
Executed qualification
Pinned Rust 1.95.0 on Linux. All 49 package tests, all-target check, strict package Clippy, formatting and both behavioral mutants verified. Canonical process-policy passed in 156.6 s. Actual shared-target policy preflight accepted the candidate source/compiler with no cache or mtime workaround. Canonical precommit passed in 492.2 s with the exact four-path selector, complete policy checks and repo-policy/xtask all-target Clippy, no skipped commands. Native process groups settled; cumulative growth 1.74 GiB stayed within 2 GiB budget, disk at least 11.60 GiB and MemAvailable at least 3.51 GiB.
Independent reviewer /root/diagnose_shared_target_freshness inspected all changed files and consumers, real-source stimulus/oracle, bounds and cleanup, both mutants and fragment. Verified 118 retained artifact hashes, committed blobs, report digest and source stamp. No material findings. Publication identity rebind and hosted proof remain pending; this is not merge readiness.
Integration and limits
Current main's separate xtask fixture changes have no affected helper/dependency overlap. Static comparison with the reviewed routing #7304 tree retains both process registrations without conflict; it does not establish future combined-tree execution.
Normal development targets remain worktree-private. This does not promise concurrent shared-target safety, arbitrary preserved-mtime edit detection, Windows runtime qualification or a whole-CI speedup. Full local workspace check-fast was not rerun; normal required hosted qualification will establish the unavailable broad dimension. No release/deployment or protection changes. Rollback is an ordinary revert of this focused patch.