objcio/tiny-networking

Please Tag Latest Commit

mgacy opened this issue · 2 comments

mgacy commented

The most recent tag, 0.4.1, does not include the latest commits adding support for loading an endpoint with Swift Concurrency. As a result, the async version of URLSession.load(_:) is only available if packages specify a dependency on TinyNetworking with a branch or revision dependency requirement. However, SPM regards these as unstable and will not allow specifying a dependency on a stable version of a package with an unstable dependency requirement.

If you specify an unstable dependency requirement in one library to have access to async await:

let package = Package(
    name: "swift-foo",
    products: [...],
    dependencies: [
        .package(url: "https://github.com/objcio/tiny-networking.git", revision: "ee700f5")
    ],
    targets: [...]
)

and try to specify a stable dependency requirement in another library that depends on it:

let package = Package(
    name: "swift-bar",
    products: [...],
    dependencies: [
        .package(url: "https://github.com/me/swift-foo.git", from: "1.0.6")
    ],
    targets: [...]
)

Dependency resolution fails:

Failed to resolve dependencies Dependencies could not be resolved because ‘swift-bar’ depends on ‘swift-foo’ 1.0.6..<2.0.0.
‘swift-foo’ >= 1.0.6 cannot be used because package ‘swift-foo’ is required using a stable-version but ‘swift-foo’ depends on an unstable-version package ‘tiny-networking’

Thank you, great point. Just tagged 0.5.0. Let me know if this works for you!

mgacy commented

@chriseidhof, this works; thanks!