-
Notifications
You must be signed in to change notification settings - Fork 420
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
Comments/cleanup to Package.swift. #371
Conversation
Added some comments and deleted two implicit dependencies; let's see if it still compiles without these. Otherwise, I'll add them back.
Looks like it doesn't compile without the implicit dependencies. Even if it did, I think they should be kept for purposes of version pinning |
I agree in terms of pinning, but I think we should pin our direct dependencies (NIO and NIOHTTP2), but not the dependencies' dependencies — those should already be pinned implicitly by pinning the direct dependencies. WDYT?
In any case, tomorrow I'll add back in whatever is needed to get this to compile.
… On 20. Feb 2019, at 18:19, Michael Rebello ***@***.***> wrote:
Looks like it doesn't compile without the implicit dependencies. Even if it did, I think they should be kept for purposes of version pinning
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This is only true as long as the direct dependencies are actually pinning (instead of using |
Re-added the transitive dependencies with the same pinning as before; PTAL. |
I noticed that Package.resolved isn't checked in, any particular reason for that? My understanding is that for dependencies following SemVer (like swift-nio) we should generally be using |
I'm not sure this is good practice; at least the NIO projects don't seem to do it. My personal stance is to be as loose as possible (i.e. use I think @rebello95 prefers to be more specific with regards to pinning, though. |
Checking in Chatted to @Lukasa about why swift-nio doesn't use Package.resolved and he said they're a bad example to follow since they don't have many upstream dependencies (apart from themselves). But note that they usually don't pin either. |
That does sound like it would combine the best of both worlds; would you (or someone at Apple) have spare cycles to set up the necessary automation? I'm not an expert on GitHub hooks/scripts/automation (or whatever we'd need for this). |
Using Hypothetically:
This would result in a dependency resolution error even though swift-nio hasn't broken backwards compatibility, and it would show up in apps that were trying to use both grpc and example-http-client, probably leading to frustration with whichever package they tried to adopt second. |
Agreed; I think using `upToNextMajor:` combined with an automatism that notifies us when dependencies break us would be optimal.
… On 21. Feb 2019, at 18:45, Kevin Sweeney ***@***.***> wrote:
Using upToNextMinor: instead of from: can easily result in "dependency hell" as well, since other libraries (for example, nio-based) could require a newer minor version of swift-nio that is still compatible with grpc-swift while still being artificially restricted.
Hypothetically:
swift-nio releases version 2.1.0
grpc-swift requires swift-nio .upToNextMinor(from "2.0.0")
example-http-client requires swift-nio from: "2.1.0"
This would result in a dependency resolution error even though swift-nio hasn't broken backwards compatibility, and it would show up in apps that were trying to use both grpc and example-http-client, probably leading to frustration with whichever package they tried to adopt second.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
For a first pass we could do this semi-manually and commit the output (just like we currently do when code-generator output changes). So someone "periodically" runs |
By the way, this is what a hypothetical error message will look like when swift-nio releases 1.13.0:
|
Little bit late, but I definitely agree with the sentiment above regarding checking in the lockfile and allowing CI to upgrade compatible dependencies 😄 |
I've added |
@rebello95 @kevints, could you please take another look at this? |
Thinking about this a bit more, doesn't this still mean that end consumers of SwiftGRPC will now need to manually pin dependencies on their end even if we don't need to for our CI? Reading through SwiftPM's documentation on
If I'm understanding correctly, it sounds like we should check in |
Pinning all our dependencies exactly would put our users in a world of hurt, because it will frequently cause unresolvable dependency graphs (see To summarize the possible options:
IIRC we have never been broken by updates |
@rebello95 Yes, end consumers depending on swift-grpc also need to check in their Pinning for example swift-nio to There are other great reliability properties of Package.resolved as well. A major one is that the shas of your dependencies are all pinned, and if you already have a checkout your build doesn't need network access at all. So you can make changes to your project and do |
@rebello95 I realized that much of what I wrote is already addressed in the swift-nio project's FAQs on its public API. One note - the @weissi has a few Tweets on this topic and @MrMage has already registered SwiftGRPC for the NIO compatibility suite here, so the breakage risk should be minimal. |
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.
@kevints and @MrMage thanks for discussing this! I'm okay with this approach assuming that downstream consumers will check in their Package.resolved
and pin these transitive dependencies as they see fit in order to allow consumers to use somewhat varying versions of dependencies. Left one comment about a non-1.x dependency, feel free to merge after.
Added some comments and deleted two implicit dependencies; let's see if it still compiles without these. Otherwise, I'll add them back.