Swift Package Registry Service

Does the latest xcode13 also support the registry?

No, nor do the Xcode 14 betas so far.

This is the critical detail. Many teams are waiting on this support because they have been using CocoaPods to support their builds but now many newer packages do not have CP support. Without this registry support it is not possible integrate SPM into build systems.

It's possible, just horrendously slow due to cloning entire repos. Or do you mean something else?

One way to improve that is to utilize the repository cache, eg. set it on CI system

That improves things a bit, especially if you're on a slow connection, but even with the cache intact SPM is very slow at resolving versions for large repos. This is exacerbated by Xcode reresolving these versions when you tell it to do a clean build of any kind.

1 Like

When working on an app which is made up of more than 50 packages it helps to switch from source to the build artifacts for most of the packages which were already built by CI/CD and stored in a registry. Having the ability to switch between source and build artifacts so developers can have 2 source packages while 48 are already built supports faster development cycles. It would be like using a folder filled with Carthage built frameworks, but instead associated with semver with a remote registry.

With SPM I do not what would be the best option for build artifacts. I expect binary frameworks which include all of the required variants would be the likely choice. I found it to be a bit tricky when I have tried to set this up manually myself. Having a registry solution integrated with the build system running by Xcode is what I hope most teams can start using soon.

1 Like

This part of the SE spec is what would be most useful to teams which support apps made up of many packages. I've used the current SPM features to link to binary frameworks while also having the source accessible with an Xcode workspace which has allowed for setting breakpoints in code because there was sufficient debug info to map between symbols and code. I've done this by building the frameworks I've modified locally so the mappings were valid. Most of the binary frameworks are not modified and so I never have to rebuild them. This has been a manually process which takes time to set up. I'd like other developers to get this with minimal effort from within Xcode directly.

Is this part of the spec included in what is nearly ready to release? @tomerd

Another option is git sparse-checkout in a wrapper swift package. I have seen some wrapper swift package examples which fake modules and download content i.e binary frameworks from external source.

But I like package registry better because I can distribute packages from mono-repo using spm (that's how it was going to work if I understand correctly?).

Do we know if this will be available in Xcode 14?

It's not in the betas, so unless it comes as part of the spring release, we likely won't see it in 14.

I am on Xcode 14.1 and I have all commands available except setting a package registry with login and password.

Error: 4 unexpected arguments: 'ā€”login', {LOGIN}', 'ā€”password', '{PASSWORD}.'

How did you make it work with JFrog without login and password subcommand?

1 Like

Looks like Package Registry is on the list for 2023 goals Swift.org - Swift project in 2023

4 Likes