Readit News logoReadit News
nazgu1 · 5 months ago
Such a big piece of history and a de facto standard for managing dependencies for Apple platforms for years.

Big "thank you" to all maintainers for your great job! And respect that you recognise moment when ecosystem changed and have courage to deprecate library instead of maintaining it forever - to leave place for migrating to new, superior solutions

cnnlives65 · 5 months ago
> superior solutions

Superior includes actual state of being better. Differences could just be differences. Maybe it’s just homoplastic.

nikanj · 5 months ago
Open source superior just means newer, even if it comes with less features and more bugs
gregoriol · 5 months ago
This is really sad, because the replacement, Swift Package Manager, is really crap: it lacks some useful features (an "outdated" command, meaningful commandline output, ...), is buggy as hell in xcode (most of the time xcode just crashes when you add/removed a dependency, error messages while getting a repository are not understandable and even often not visible entirely, many repositories have some old Package.swift that current developer tools won't read, ...), and worst of all, it stores the full repositories of all the dependencies with their full history on your machine and downloads them every time when you do CI properly, which often means GBs of data.
rTX5CMRXIfFG · 5 months ago
I don’t know, I’ve never had those problems and my codebases reach 600k+ LOC. I’ve certainly had plenty of errors to deal with Cocoapods and obsolete frameworks though, though those projects also tend to use pretty much every third-party lib that gets attention on Medium.

Modularizing an Xcode project with local Swift packages has been the best productivity gain in my experience. Doing something similar with Cocoapods is a headache.

gregoriol · 5 months ago
Local Swift packages are indeed improving the experience a little bit: better version management, less xcode crashes, slightly more explicit errors, but still highly troublesome. It really feels like Apple's teams are not using any of SwiftPM themselves.
cosmic_cheese · 5 months ago
SwiftPM been little trouble for me, with the most complex project involving a number of external packages and a couple of local ones. No crashes or anything like that.

It’s been way, way less trouble than CocoaPods was before I switched several years ago. CocoaPods was so bad about screwing itself up that I’d just check in its dependencies in a building state and avoid upgrading anything unless I absolutely had to, because inevitably when doing updates or even just resolving my project would somehow hit some number of the many edge cases that’d cause it to blow up.

In contrast with SwiftPM I keep most dependencies pretty close to current because it’s painless to do so.

In fact it’s been good enough to me that I wish it were possible to replace the awful mess that is Gradle with SwiftPM (or a 1:1 JVM counterpart) on the Android side. I need approximately none of Gradle’s flexibility and bells and whistles that make it such a pain in the rear, so something with SwiftPM’s simplicity would be a serious QoL improvement.

meisel · 5 months ago
Yeah, I’ve hit many pain points over the years with SwiftPM. Its restrictions on compiler flags is also problematic.
atommclain · 5 months ago
My biggest criticism with SPM is that there doesn't seem to be a way to use it with git worktree since the package cache is centralized as opposed to being at the directory/project/workspace level.
wahnfrieden · 5 months ago
Can you elaborate on the use case? I've started putting my local package dependencies into Vendor/ submodules in the repo I'm using them. I can't use worktrees with this setup?
kiliankoe · 5 months ago
If you're looking for an outdated command, maybe this works for you? https://github.com/kiliankoe/swift-outdated/

Disclaimer: I wrote this (a while back)

gregoriol · 5 months ago
I'm using it, thanks so much for making it :-) It should have been part of the swift base tools, it is very useful.
tomaskafka · 5 months ago
Sounds like Microsoft’s “Embrace Extend Extinguish” approach that everyone hated (and some successfuly sued) has found a new home at Apple.

1 take over the thing 2 succeed at it as a platform owner 3 not put in resources to do it well

secretsatan · 5 months ago
Yeah, no, cocoapods was a nightmare compared to SPM, every ios update supplied a new unsolved issue in one pod or another that required dark incantations.

Managing a local pods caused issues so great engineers quit

gwbennett · 5 months ago
100% agree!
wahnfrieden · 5 months ago
Tuist
richrichardsson · 5 months ago
In spite of search engines being a thing, this comment could have done with a bit more information. I assume you're talking about this: https://docs.tuist.dev/en/
myko · 5 months ago
I will never start another Apple platform application without Tuist. If I start work on one I will do my best to get buy-in to switch.
einsteinx2 · 5 months ago
Finally!! I never liked CocoaPods due to how it “takes over” your Xcode project. I used to prefer Carthage, then just git submodules, then SPM. In my last job I oversaw SDK development and CocoaPods was the bain of my existence. Constant CDN problems causing release delays, annoying extra file in Ruby to maintain, different behavior than our other releases due to how CocoaPods builds projects, etc. SPM was as simple as pushing a git tag and maintaining a simple Swift file, while pushing to CocoaPods was rolling the dice how many times I’d get an error message. Good riddance!
secretsatan · 5 months ago
It was a product of it’s time, it highlighted an issue that apple never really addressed, i have much more confidence in the future of SPM because at least it seems to be moving in tandem with Swift
monocularvision · 5 months ago
I agree entirely. I feel like CocoaPods should have done this shortly after iOS 8 was released when dynamic frameworks were added. It was a terrible solution to a problem that way outlived its usefulness and because of that has absolutely polluted the ecosystem.
jbverschoor · 5 months ago
Finally someone sane.
ardit33 · 5 months ago
lol... you really don't like it, do you. I used it for a couple of my projects, and I kinda agree with you. I didn't like it at all how it took over projects (you have to use a workspace).

For my small personal projects, eventually I ended up into reverting to just downloading the dependencies myself into a lib folder. A bit more work upfront, but simpler builds and you know what's going into your project.

I think it had its use and time, and it is good for the maintainers to mark it deprecated and time to move on.

einsteinx2 · 5 months ago
Haha I really don’t, but I do get why others liked it, it was just never for me. I also forgot the intermediate step I took between git submodules and SPM where I did exactly what you did with manually adding deps to the project. Git submodules is it’s own frustrating hell lol…

More recently though the lack of maintenance of the CDN causing lots of problems not only publishing but even just pod installs failing was really frustrating, and as an SDK/framework maintainer just having to support multiple package managers was a huge pain in the ass. Especially with React Native requiring CocoaPods and having its own weird problems we have to solve in the pod file.

But yeah glad to see it being sunset now that there’s an officially sanctioned package manager. I know some people will complain that SPM isn’t as full featured as CocoaPods but I’ve found it gets the job done and the fact it’s both run off a simple Swift file and git tags and has official support from Apple is great. Kind of reminds me of Carthage for the modern age, in a good way.

karel-3d · 5 months ago
The reasoning is here, from 2024

https://blog.cocoapods.org/CocoaPods-Support-Plans/

The timeline in the original article seems very reasonable to me. They go out of their way to avoid breakages.

seanalltogether · 5 months ago
Apple has always made it painful to step too far off the path with their tooling and frameworks and cocoapods was not immune to that pain. I'm grateful of what they made and the pressure they put on Apple to make things better, but I was very happy to remove yet another 3rd party dependency from our toolchain the moment we were able to.
Terretta · 5 months ago
> Apple has always made it painful to step too far off the path

Or, "Apple has always avoided spending dev cycles too far off the path, electing instead to make the path itself easier."

xCode with built-in live rebuild preview simulator plus xCode Cloud with Testflight which auto-builds on git push is a remarkable value for $8.33 a month.

jamil7 · 5 months ago
> xCode with built-in live rebuild preview simulator

You couldn't have picked a slower, more buggy, opaque feature to highlight here. Its useful for UI work when it works properly but I feel like I have to mentally prepare myself everytime I switch the canvas on to avoid throwing the computer out the window.

I'll agree on Xcode Cloud though, integrated CI, signing and TestFlight builds with minimal hassle is very nice.

AJRF · 5 months ago
Doesn't React Native depend on this very heavily for iOS?
oefrha · 5 months ago
Yeah, and according to https://expo.dev/blog/precompiled-react-native-for-ios and linked https://github.com/react-native-community/discussions-and-pr..., it seems moving off CocoaPods has barely moved past planning stage. Latest update from two weeks ago links to https://github.com/facebook/react-native/pull/52909 and says it’s very very experimental. Just great…
robertjpayne · 5 months ago
It's not actually that concerning. RN's pods are vended via npm not trunk so trunk going read-only will not have an outsized impact on RN.

The risk is that over time Cocoapods will no longer work to integrate dependencies with ways Xcode wants them to be.

Switching to SPM is a massive undertaking for a large project with many intertwined dependencies and configuration options. It's far less configurable than Cocoapods with basically no scripting options during install.

Their progress already is pretty decent!

AJRF · 5 months ago
Gosh, that is a worry. Maybe I can help out here (I imagine the politics of a project this large will frustrate me though)
cthulberg · 5 months ago
arnath · 5 months ago
Flutter has moved to Swift Package Manager, it’s just not enabled by default iirc
chairhairair · 5 months ago
Already has complete support for SPM.
mrbombastic · 5 months ago
It does, in recent react native versions they show a deprecation warning when running “pod install” directly which is probably a signal they are working on moving to other package managers, but not aware of what the plan is.
oulipo2 · 5 months ago
Capacitor too, for hybrid mobile apps

Deleted Comment

everyone · 5 months ago
Unity also afaik.
ChrisMarshallNY · 5 months ago
It was useful, but way too delicate.

I didn't like the way that it rewrote my project structure.

Once Swift Package Manager matured, I stopped using CocoaPods.

josteink · 5 months ago
As someone with no direct love of CocoaPods... Is there a way to use SPM for mixed ObjC and Swift projects?

I'd love to know if I have options :)

andrewjl · 5 months ago
As long as the Obj-C and Swift are in separate source or binary targets, SPM supports them being in the same package.

There was a Swift Evolution proposal at one point to go all the way and bring in support for mixed Obj-C and Swift targets [1] but it was returned for revision. It talks about the multiple target workarounds:

> Distribute binary frameworks via binary targets. Drawbacks include that the package will be less portable as it can only support platforms that the binaries support, binary dependencies are only available on Apple platforms, customers cannot view or easily debug the source in their project workspace, and tooling is required to generate the binaries for release.

> Separate a target’s implementation into sub-targets based on language type, adding dependencies where necessary. For example, a target Foo may have Swift-only sources that can call into an underlying target FooObjc that contains Clang-only sources. Drawbacks include needing to depend on the public API surfaces between the targets, increasing the complexity of the package’s manifest and organization for both maintainers and clients, and preventing package developers from incrementally migrating internal implementation from one language to another (e.g. Objective-C to Swift) since there is still a separation across targets based on language.

The upshot is that SPM has a better interoperability story with Swift and C++ [2] and maybe that can serve as a foundation for getting to the same level of interop for Obj-C.

[1]: https://github.com/swiftlang/swift-evolution/blob/main/propo...

[2]: https://www.swift.org/documentation/cxx-interop/

kenshi · 5 months ago
Yes, you can use SPM to package up Objective-C code.
ChrisMarshallNY · 5 months ago
I'm not sure. I suspect so, but I haven't used ObjC since 2014.
aravindputrevu · 5 months ago
Isnt this a old news? I'm thinking of Swift Package manager for all the stuff new.
gregoriol · 5 months ago
From my experience, about 20-30% of the packages are not working with swiftpm, either because they don't have a Package.swift file, or because it is not compatible with up-to-date developer tools. On many projects, I had to fork a few repositories just to add or fix the swiftpm integration... while their Pod integration has always been working well.
rTX5CMRXIfFG · 5 months ago
That is the cost of using third party libraries, hardly the fault of either SPM or Cocoapods.
manmal · 5 months ago
I‘d say it’s 2% now, of the maintained ones? I haven’t seen such a project in a long while now. React Native is the only one I can think of.