You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, a branch is specified instead of a version number. This causes an issue when linking the Socket library to a package.
E.g. if I'm making a package and I add a dependency like this:
I get an error, because SPM doesn't allow mixing and matching a stable version of the Socket package with an "unstable" version of the swift-system dependency:
Failed to resolve dependencies Dependencies could not be resolved because root depends on 'socket' 0.3.2..<1.0.0.
'socket' >= 0.3.2 cannot be used because no versions of 'socket' match the requirement 0.3.3..<1.0.0 and package 'socket' is required using a stable-version but 'socket' depends on an unstable-version package 'swift-system'.
A workaround is to use an "unstable" version for both (or rather a version that SPM deems unstable). For example, I'm linking a specific commit (for version 0.3.2):
+1 to this! I've got a fork which fixes this issue but it'd be good to be able to merge this in to the source repo so that development doesn't get split.
Is there a reason that you'd like swift-system to be able to be compiled as a separate dynamic library instead of directly into the Socket library? I assume it's probably code size, but a debug build of Socket (as a dylib) is 1.6mb and a release build is 889kb, so you wouldn't be saving much by ensuring that the same copy of swift-system is used everywhere.
@colemancda I'd love to hear your opinion on how this issue should be approached!
Tl;dr
SwiftPM considers Socket unstable because it depends on your swift-system fork via a branch dependency, which in turn makes it impossible to use Socket without making your own package unstable afaict (and definitely not in a way that has the benefits of semver).
Hello,
The
swift-system
dependency is currently specified asSo, a branch is specified instead of a version number. This causes an issue when linking the Socket library to a package.
E.g. if I'm making a package and I add a dependency like this:
I get an error, because SPM doesn't allow mixing and matching a stable version of the
Socket
package with an "unstable" version of theswift-system
dependency:A workaround is to use an "unstable" version for both (or rather a version that SPM deems unstable). For example, I'm linking a specific commit (for version 0.3.2):
However, as you can imagine, it's not super convenient :)
If you could fix the dependency declaration for the
swift-system
package, it would be much appreciated!In any case, thank you for your work! :)
The text was updated successfully, but these errors were encountered: