-
Notifications
You must be signed in to change notification settings - Fork 998
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
Discard insufficient fork markers #10682
base: main
Are you sure you want to change the base?
Conversation
Once discarded, do we just produce the same lockfile anyway? (If so, does this actually fix anything?) |
That's the other half of #10669: the lockfile we're seeing is invalid, it doesn't cover all possible environments. We should never produce a lockfile in this state (fixing #10669), this new branch is error recovery from a buggy state. This PR exists because i minimized #10669 to this problem by keeping the lockfile, while we still need to fix the problem where we produce this lockfile starting from a pyproject.toml. |
Ok. My question is: does this actually produce the correct lockfile? Or even with this change, are we still producing the incorrect lockfile after invalidating? |
If checked that when running There are two ways to create the lockfile: A)
B)
(A) has a slightly larger diff to |
6cbcccf
to
e5e8e8f
Compare
}; | ||
// We respect requires-python in addition to the environments the use specified. | ||
environments_union.and(requires_python.to_marker_tree()); | ||
if fork_markers_union != environments_union { |
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.
Do they have to be exactly equal...? Could one be a superset?
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'm on the fence whether to do an equality check or a contains check, i like the equality check because it should catch more bad markers, but we can already revert that to if fork_markers_union.negate().is_disjoint(environments_union)
.
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.
Lets do the more conservative thing (contains) for now... I'm just worried that this could have a significant impact and doesn't have a ton of testing, does it?
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 would prefer to change this but don't feel confident enough doing it myself, so it may miss this release.
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.
done
c9946b6
to
09ca582
Compare
I'll tweak and merge this. |
568ea23
to
75a28a2
Compare
In #10669, a pyproject.toml with requires-python but no environment had a lockfile covering only a subset of the requires-python space: ```toml resolution-markers = [ "python_full_version >= '3.10' and platform_python_implementation == 'CPython'", "python_full_version == '3.9.*'", "python_full_version < '3.9'", ] ``` This marker set is invalid, we have to reject the lockfile. (We can still use the versions though, to avoid churn).
75a28a2
to
7a6e478
Compare
In #10669, a pyproject.toml with requires-python but no environment had a lockfile covering only a subset of the requires-python space:
This marker set is invalid, we have to reject the lockfile. (We can still use the versions though, to avoid churn).
Part 1/2 of #10669