fix(toolexec): rebuild synthetic test imports - #879
Conversation
Implicit test coverage gives the package under test a binary-local archive. Instrumentation-added compiler imports are absent from the Go package graph, so ordinary importer archives can retain a conflicting fingerprint and fail at link time. Preserve satisfied import provenance and rebuild affected importer closures in a target-specific tool flavor. Carry authoritative archives through nested compilation, record validated closure metadata on the test main, and replay or reconstruct it at link time without polluting ordinary build cache entries. Keep same-package cycles rejected and add regression coverage for external tests, cache reuse, explicit coverage, and stale metadata.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f0bbdbd65
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Read compiler fingerprints only from `_go_.o` so package export data cannot supply a false compatibility identity. Resolve test target provenance only after finding a synthetic importer that needs a reverse variant. This preserves test-only packages that have no ordinary export archive or import configuration entry.
|
🎯 Code Coverage (details) 🔗 Commit SHA: 85c012a | Docs | View more details | Give us feedback! |
…iding a workaround/solution
Exercise reverse-variant environment parsing, archive fingerprint errors, metadata compatibility, reconstruction guards, and version flavoring. Add focused integration coverage for rebuilding a standalone synthetic importer against an authoritative test target.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5a0a3be24a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Parse the documented variable-length textual Go object header instead of limiting reads to 4 KiB. This preserves fingerprint validation for valid archives with long build IDs and rejects malformed object members instead of treating them as fingerprint-free.
Inject the reverse-package resolver into cached test-main metadata refreshes so reconstruction behavior can be exercised without a jobserver. Cover successful archive replacement and every reconstruction error, including fingerprint mismatches. This keeps incompatible archives out of linker import configuration.
Implicit test coverage gives the package under test a binary-local archive. Instrumentation-added compiler imports are absent from the Go package graph, so ordinary importer archives can retain a conflicting fingerprint and fail at link time.
Preserve satisfied import provenance and rebuild affected importer closures in a target-specific tool flavor. Carry authoritative archives through nested compilation, record validated closure metadata on the test main, and replay or reconstruct it at link time without polluting ordinary build cache entries.
Keep same-package cycles rejected and add regression coverage for external tests, cache reuse, explicit coverage, and stale metadata.
Fixes #875 (to the extent of what's possible)