-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Do not store products in resolved file #2792
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
Do not store products in resolved file #2792
Conversation
We can safely make the assumption that any dependency in the resolved file was required.
@swift-ci please smoke test |
@@ -117,7 +110,7 @@ public final class PinsStore { | |||
public func createConstraints() -> [RepositoryPackageConstraint] { |
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.
you can remove this method, it's dead code
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.
Ah right, I'll make a follow up to clean this up.
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.
@@ -117,7 +110,7 @@ public final class PinsStore { | |||
public func createConstraints() -> [RepositoryPackageConstraint] { | |||
return pins.map({ pin in | |||
return RepositoryPackageConstraint( | |||
container: pin.packageRef, requirement: pin.state.requirement(), products: pin.productFilter) | |||
container: pin.packageRef, requirement: pin.state.requirement(), products: .everything) |
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.
Won’t this constraint mean that every pin could potentially want more of its transitive dependencies after it’s loaded than when it was pinned?
If a package is resolved was at 1.0.0 for use of product B, then it will be pinned at 1.0.0 with no product information (which ought to be somehow inferable). Upon loading the pins, it will be loaded at 1.0.0 for use of products A and B, and the resolver will go hunting for all of product A’s dependencies. Or is that not what happens?
Passing .specific([])
might work instead, because I think the resolver will still get the remaining product‐based constraints from the manifests anyway.
I will try both variants and get back to you.
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 constraints are no longer actually being used by the resolver, I removed this method in #2793
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.
Yes, I see that now. It makes things much simpler.
I did have time to try it in several variations before I got your last message, and it functioned just fine in everything I tried. But there was one minor quirk. If a leftover |
Is there a strong reason to store products in |
No. It seems to have been an unintentional side effect of adding the |
If I simply bump the
I think it ought to be possible to go without recording the product filter in the
I’m now investigating other ways of determining the proper filter at those points. |
I think I’ve gotten it working without needing a record of the products in |
I filed #2794 to complete the clean‐up. |
We can safely make the assumption that any dependency in the resolved file was required.
We can safely make the assumption that any dependency in the resolved file was required.