-
Notifications
You must be signed in to change notification settings - Fork 760
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
Propagate fork markers to extras #6065
Conversation
This isn't quite doing the right thing in |
I think my change is correct but now hitting the aforementioned instability. |
// true), but is a more robust approach that should | ||
// capture all cases. | ||
marker: self.markers.fork_markers().cloned().unwrap_or_default(), | ||
marker: MarkerTree::TRUE, |
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.
I moved this into graph construction, since we're now AND-ing the fork markers with every edge.
20be943
to
d705164
Compare
{ name = "package-b", version = "1.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'pypy'" }, | ||
{ name = "package-b", version = "2.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'cpython'" }, | ||
{ name = "package-b", version = "1.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'pypy' and sys_platform == 'darwin'" }, | ||
{ name = "package-b", version = "2.0.0", source = { registry = "https://astral-sh.github.io/packse/PACKSE_VERSION/simple-html/" }, marker = "implementation_name == 'cpython' and sys_platform == 'darwin'" }, |
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.
These may not be strictly necessary... Because you can only reach this node on sys_platform == 'darwin'
.
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.
(Yeah confirmed. Is it wrong to include then?)
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.
I don't think it's wrong, but it does seem superfluous. But I'm okay to run with it for now.
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.
I think this looks right to me.
In terms of moving this PR forward, maybe I cherry pick this PR into my branch that will (hopefully) fix the instability issue? So it won't get merged right away, but it will be in an active branch somewhere.
@@ -1901,8 +1897,8 @@ dependencies = [ | |||
{ name = "packaging" }, | |||
{ name = "regex" }, | |||
{ name = "rich" }, | |||
{ name = "tensorflow-text", version = "2.7.3", source = { registry = "https://pypi.org/simple" }, marker = "platform_system != 'Darwin'" }, | |||
{ name = "tensorflow-text", version = "2.15.0", source = { registry = "https://pypi.org/simple" }, marker = "platform_system != 'Darwin'" }, |
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.
Ouch, not good!
{ name = "tensorflow-text", version = "2.7.3", source = { registry = "https://pypi.org/simple" }, marker = "platform_system != 'Darwin'" }, | ||
{ name = "tensorflow-text", version = "2.15.0", source = { registry = "https://pypi.org/simple" }, marker = "platform_system != 'Darwin'" }, | ||
{ name = "tensorflow-text", version = "2.7.3", source = { registry = "https://pypi.org/simple" }, marker = "python_version < '3.13' and platform_system != 'Darwin'" }, | ||
{ name = "tensorflow-text", version = "2.15.0", source = { registry = "https://pypi.org/simple" }, marker = "python_version >= '3.13' and platform_system != 'Darwin'" }, |
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.
So that's a bugfix.
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.
Yup! ANd there's no extra here.
@@ -3144,7 +3144,7 @@ name = "redis" | |||
version = "5.0.8" | |||
source = { registry = "https://pypi.org/simple" } | |||
dependencies = [ | |||
{ name = "async-timeout", marker = "python_full_version < '3.11.[X]'" }, | |||
{ name = "async-timeout", marker = "python_full_version < '3.11.[X]' and python_version < '3.12'" }, |
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.
This looks wrong. I don't know where it's coming from.
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.
Debugging this.
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.
I haven’t figured this out yet, I think I should understand why this is happening before we merge @BurntSushi though you’re welcome to cherry-pick.
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.
Oh... I guess this is actually fine.
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.
It's just redundant.
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.
I needed to see it with fresh eyes.
Very hard to explain but regarding the instability: it has to do with the fact that when we resolve without a lockfile, we create the fork on the dependencies of the When we resolve with a lockfile, we fork on the project itself... So when we go to solve for that project's dependencies, we already have a |
That might need to be solved holistically, though fixing the normalization to detect disjointness for these would also help. |
Basically, we end up with this bad fork due to the confusion:
|
Rebasing on #6076 does fix one of the instabilities, but |
99abf46
to
fbefe60
Compare
Is this the only issue? If so, I'd say flip this test to non-deterministic (like |
Yeah will do. |
fbefe60
to
b540a6a
Compare
b540a6a
to
acb3f31
Compare
Summary
When constructing the
Resolution
, we only propagated the fork markers to the package node, but not the extras node. This led to cases in which an extra could be included unconditionally or otherwise diverge from the base package version.Closes #6062.