-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[WIP] Add Support for Swift Package Manager #7344
Conversation
Awesome, thanks @0xTim! Looking forward to digging into this PR, it might take a few days before we get to it, but just wanted to let you know we're excited about this. |
@jurre great! There's still a fair bit to do so I'll ping you when it's in a reasonable state! |
This is an awesome addition! Excited to see it come together One thing I'll note: XCode projects will use a While Swift libraries and "Swift on Server" style projects will use Apologies if you've already considered this and chose to require Package.swift for other reasons. I wanted to raise it because this "2 ways of specifying dependencies" model has bitten me before! |
@lseppala I would say Xcode projects are out of scope for the time being. I could look into it once the initial support is added but a) it's not a priority for me personally and b) trying to reverse engineer the Xcode project that can change with different Xcode versions might cause more problems. (I'm also half expecting in a couple of years that the Swift Playground app manifest will also be used for Xcode apps) |
Hei @0xTim, thanks for this! Swift support is now finally on top of our list and I plan to spend a bit of time getting this into a workable state. Is there any uncommitted work you'd like to share on top of this branch? I'm planning to use this as a starting point. |
@deivid-rodriguez just checked and I have several unfinished spikes but nothing worth committing! Do you want to take this over wholesale or is the plan to collaborate and guide the PR through with contributions from me? (Either work to be clear!) |
Planning to take this over wholesale, but I'm sure I'll come back with questions about Swift is that's ok with you! |
Ok great, reach out and I'll help where I can! |
One question @0xTim. Current implementation resolves each package name from its url, using the However, I'm observing that the {
"object": {
"pins": [
{
"package": "LinkedList",
"repositoryURL": "https://github.com/mona/LinkedList.git",
"state": {
"branch": null,
"revision": "79b05a5da89557a4fa50647cc92488a3d9c3f478",
"version": "1.2.2"
}
},
...
]
}
} Do you think it would be more preferable to use that instead (or just the full URL if there's no lockfile)? It seems simpler to me. My assumption is that Swift either does not allow conflicting package names, or resolves them somehow, saving an unambiguous package name to the lockfile. Thoughts? |
@deivid-rodriguez IIRC I like the idea of using the full URL as identifier, but |
Thanks! Another question. How do Swift users normally update dependencies? What I gathered so far is:
Are the above correct? Is that how users normally manage swift dependencies? |
Correct for the time. There was an accepted proposal to add such functionality, but unfortunately it’s not implemented yet. Until that lands developers have to edit the file manually.
Correct. And there’s also a
Exactly👍 SwiftPM will check if the resolved packages in |
Hei! I'm working on swift updates at #7525, so let's close this PR and move the discussion there. I will add some attribution there to previous contributors of the initial skeleton :) @steveapple I have some other questions in case you're still happy to help 😄. |
Feel free to mention me:) |
This PR adds support for Swift via the Swift Package Manager. This PR is heavily based upon #3772 and #5562 but updated for the latest SwiftPM changes and to fit in with the current requirements for language support in Dependabot.
Fix: #1245