apple / swift-nio-transport-services

Extensions for SwiftNIO to support Apple platforms as first-class citizens.
https://swiftpackageindex.com/apple/swift-nio-transport-services/main/documentation/niotransportservices
Apache License 2.0
282 stars 71 forks source link

URGENT : NIOTransportServices / NIOTSConnectionBootstrap is only available in macOS 10.14 or newer #159

Closed felswa closed 1 year ago

felswa commented 1 year ago

Hi. I have pulled updated my SPM in the past 30min and am getting this error which means I cannot build my entire project

if swift(>=5.6)

@available(*, unavailable) extension NIOTSConnectionBootstrap: Sendable {}

endif

in NIOTSConnectionBootstrap.swift

These is my current Package. I am set to .v12 but it is possible that one of the packages is not. If you can please fix this issue. Thanks.

/////

import PackageDescription

let package = Package( name: "DM123", platforms: [ .macOS(.v12) ], dependencies: [ // 💧 A server-side Swift web framework. .package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"), .package(url: "https://github.com/vapor/fluent.git", from: "4.0.0"), .package(url: "https://github.com/vapor/fluent-mysql-driver.git", from: "4.0.0"), .package(url:"https://github.com/vapor/queues.git",from: "1.3.2"), .package(name: "QueuesFluentDriver", url: "https://github.com/m-barthelemy/vapor-queues-fluent-driver.git", from: "2.0.0"),

Expected behavior

[what you expected to happen]

Actual behavior

[what actually happened]

Steps to reproduce

  1. ...
  2. ...

If possible, minimal yet complete reproducer code (or URL to code)

[anything to help us reproducing the issue]

SwiftNIO version/commit hash

[the SwiftNIO tag/commit hash]

Swift & OS version (output of swift --version && uname -a)

glbrntt commented 1 year ago

What's the error you're seeing?

felswa commented 1 year ago

Hi. The project cannot build. On that line of code it says "NIOTSConnectionBootsrap is only available in macOS 10.14 or newer". Thanks.

felswa commented 1 year ago

if swift(>=5.6)

@available(*, unavailable) extension NIOTSConnectionBootstrap: Sendable {}

endif

in NIOTSConnectionBootstrap.swift

Skoti commented 1 year ago

I believe it's because: extension NIOTSConnectionBootstrap is not included inside the missing else clause in:

#if swift(>=5.6)
@available(*, unavailable)
extension NIOTSConnectionBootstrap: Sendable {}
#endif

thus for swift 5.6 it tries to extend unavailable type.

I think it needs to be fixed for all such types that where marked unavailable between 1.13.1 and 1.14.0

felswa commented 1 year ago

Also, you have the following Package dependencies:

vapor -> async-http-client -> swift-nio-transport-services

In async-http-client Package & swift-nio-transport-services there does not seem to be a minimum platform version specified.

felswa commented 1 year ago

Thank you. Is it possible to do a new release so that we can pick up via SPM?

glbrntt commented 1 year ago

https://github.com/apple/swift-nio-transport-services/releases/tag/1.14.1

Skoti commented 1 year ago

Thanks for a quick fix! 🚀

felswa commented 1 year ago

Thanks very much!!

On Sep 28, 2022, at 4:21 PM, Skoti @.***> wrote:

Thanks for a quick fix! 🚀

— Reply to this email directly, view it on GitHub https://github.com/apple/swift-nio-transport-services/issues/159#issuecomment-1261074007, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMU6Z6BURFQPV33HCNTGOKDWARO7DANCNFSM6AAAAAAQXZZPQA. You are receiving this because you authored the thread.