fix(bindeps): load targets before downloading artifacts#17073
fix(bindeps): load targets before downloading artifacts#17073npmccallum wants to merge 2 commits into
Conversation
|
r? @epage rustbot has assigned @epage. Use Why was this reviewer chosen?The reviewer was selected based on:
|
| } | ||
|
|
||
| #[cargo_test] | ||
| fn transitive_build_script_artifact_dependency_with_valid_target_does_not_panic() { |
There was a problem hiding this comment.
Add coverage for a git dependency whose build script has a path artifact build-dependency with an explicit target. This matches the topology from rust-lang#16881 and records the expected successful build behavior before changing target loading.
Artifact dependencies can introduce additional compile targets through manifest target fields. Cargo loaded those targets during feature resolution for some paths, but PackageSet::download_accessible could encounter a transitive artifact build-dependency before the target data had been populated. When that happened, dependency platform filtering asked for cfg data for an unknown target and panicked. Load artifact dependency targets during the same traversal that follows them for downloads, so target cfg data is available before filtering recurses into that target. Closes rust-lang#16881.
54ddd7f to
b72f42d
Compare
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
Thanks, addressed the structure feedback by splitting this into two commits:
The test-only commit passes locally, and the final commit keeps the production change separate. Verified: |
If that is the case, then why does the fix not change the tests? Also, what does |
Artifact dependencies can introduce additional compile targets through manifest
targetfields. Cargo loaded those targets during feature resolution for some paths, butPackageSet::download_accessiblecould encounter a transitive artifact build-dependency before the target data had been populated.When that happened, dependency platform filtering asked for cfg data for an unknown target and panicked. Load artifact dependency targets during the same traversal that follows them for downloads, so target cfg data is available before filtering recurses into that target.
The regression covers a git dependency whose build script has a path artifact build-dependency with an explicit target, matching the topology reported in the issue.
Closes #16881.