-
Notifications
You must be signed in to change notification settings - Fork 995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect visitation order for proxy packages #10833
base: main
Are you sure you want to change the base?
Conversation
This reverts commit 56d39d2.
480e17a
to
d389f03
Compare
Would it fix #10425 if we visited the virtual packages inside the package-batch first? Like:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #10853 for a follow-up
// Verify that the package is allowed under the hash-checking policy. | ||
if !self | ||
.hasher | ||
.allows_package(candidate.name(), candidate.version()) | ||
{ | ||
return Ok(None); | ||
} | ||
|
||
// Emit a request to fetch the metadata for this version. | ||
if self.index.distributions().register(candidate.version_id()) { | ||
// Verify that the package is allowed under the hash-checking policy. | ||
if !self | ||
.hasher | ||
.allows_package(candidate.name(), candidate.version()) | ||
{ | ||
return Err(ResolveError::UnhashedPackage(candidate.name().clone())); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are the hash changes coming from?
/// Main priority and tiebreak for virtual packages | ||
type Priority = (Option<PubGrubPriority>, u32); | ||
/// Main priority and tiebreak for virtual packages. | ||
type Priority = (Option<PubGrubPriority>, Option<PubGrubTiebreaker>); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #10853
Summary
This PR reverts #10441 and applies a different fix for #10425.
In #10441, I changed prioritization to visit proxies eagerly. I think this is actually wrong, since it means we prioritize proxy packages above everything else. And while a proxy only depends on itself, it does mean we're selecting a version for the proxy package earlier than anything else. So, if you look at #10828, we end up choosing a version for
async-timeout
before we choose a version forlangchain
, despite the latter being a first-party dependency. (async-timeout
has a marker on it, so it has a proxy package, so we solve for it first.)To fix #10425, we instead need to make sure we visit proxies in the order we see them. I think the virtual tiebreaker for proxies is reversed? We want to visit the package we see first, first.
So, in short: this reverts #10441, then corrects the ordering for visiting proxies.
Closes #10828.