Since Apple presenter on WWDC23 a new type of linking libraries - mergeable (a combined type of static and dynamic library), and this type appeared as a flag in xcframework settings section
However there are still 2 types of libraries in SPM: static and dynamic, hence I want to propose to add a third type of linking library - mergeable, that will allow us to flexible configure our packages.
The practical crux of that concern is packages carelessly or unwittingly making themselves Apple-platform-specific, right?
In which case, it's not so much the presence of an Apple-platform-specific feature that's the issue, it's just whether it has an implicit fallback for other platforms. If a 'mergeable' linking mode meant e.g. 'static' on non-Apple platforms, might that be passable?
Yes, that would be acceptable. They can even do this with a separate flag in the SPM package configuration. But at the moment there are no such flags, and in fact you can only use mergeable libraries in xcframework
I have a few concerns, one is the one you're alluding to, but there are a couple others:
is it the correct design that PackageDescription would be a superset of all the platform specific options or do we need a different design to scale to potentially many different platforms having opinions? For example, we're already getting a lot of confusion from having the platforms API which ends up being a way to express the Apple platform specific concept of minimum deployment targets.
is mergeable really something the package author should choose or is it something that needs to be chosen by clients? We have this problem currently with dynamic which typically ends up being something the client wants to pick, not the package author.