by zacwest · 5y ago · 0 comments
I do not believe SPM is mature enough to be the entire platform, and worst yet if you experience any problems it is entirely impossible to customize the behavior. I think it's going to be another year or 2 before dropping CocoaPods entirely is a fair choice for libraries -- SPM works for the most basic use cases, but not all.
That's fixed in Xcode 12.5 https://developer.apple.com/documentation/xcode-release-note...
Looks like this happens for chained dependencies ("a Swift package with binary dependencies", below), in apps with extensions (I have none).
This is from the 12.4 notes[0]:
> If you use a Swift package with binary dependencies in an app with extensions, the build system incorrectly embeds the binary dependencies alongside the extension in the PlugIns directory, causing validation of the archived app to fail. (69834549) (FB8761306) Workaround: Add a scheme post-build action which removes the embedded binaries from the PlugIns directory after the build, e.g. rm -rf "${TARGET_BUILD_DIR}/${TARGET_NAME}.app"/PlugIns/.framework.*
I do not see a note in the 12.5 notes addressing this[1].
[0] https://developer.apple.com/documentation/xcode-release-note...
[1] https://developer.apple.com/documentation/xcode-release-note...
Maybe, we could have found more in common than you may think. We both seem to be passionate about the same kind of stuff.
I was under the impression that we should make an effort to be a wee bit more respectful with each other, than we might in venues like Reddit or SO (where they have the "digital sneer" down to a science).
That was the only thing I could find that mentioned anything like it at all.
I checked my builds every which way from Sunday, and I never had a double-embedded static lib. I was wondering if they may have been mixed up.
Otherwise, there's nothing at all about it.
I pretty much always use static libs, but sometimes, I may need a .framework. I've been using SPM for months, and have published a bunch of libs. I do tend to be conservative, and reduce the surface of dependencies wherever possible. I eat my own dog food, and am the only consumer (that I know of) of my packages. My chains tend to be short.
For libraries this is probably true, but I would imagine that most apps could start on SPM from today and never need to introduce CocoaPods or Carthage (we did, ~1 year ago). There are certainly limitations, but they are disappearing fairly rapidly, and the advantage of simpler builds, no Ruby setup, simpler Xcode project structures, etc, are worthwhile.
I don't see the libraries being embedded in my project, but maybe I need to use something like iMazing to look at the package.