Closed helje5 closed 3 years ago
OK, can repro that. Added this to MacroExamples:
dependencies: [
...
.package(url: "https://github.com/apple/swift-nio-ssl.git",
from: "2.13.0")
...
targets: [
.target(name: "httpd-helloworld", dependencies: [ "Macro", .product(name: "NIOSSL", package: "swift-nio-ssl") ]),
$ swift lambda build -d 5.3 -p httpd-helloworld
/Users/helge/tmp/MacroExamples/.build/checkouts/swift-nio-ssl/Sources/NIOSSL/SSLCertificate.swift:301:16: error: cannot use type alias 'time_t' here; 'CNIOBoringSSL' has been imported as implementation-only
public var notValidBefore: time_t {
^ ~~~~~~
CNIOBoringSSL.time_t:1:18: note: type declared here
public typealias time_t = __time_t
^
/Users/helge/tmp/MacroExamples/.build/checkouts/swift-nio-ssl/Sources/NIOSSL/SSLCertificate.swift:310:16: error: cannot use type alias 'time_t' here; 'CNIOBoringSSL' has been imported as implementation-only
public var notValidAfter: time_t {
^ ~~~~~~
CNIOBoringSSL.time_t:1:18: note: type declared here
public typealias time_t = __time_t
Adding an explicit import to SSLCertificate.swift fixes the issue for me:
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
import struct Darwin.time_t
#elseif canImport(Glibc)
import struct Glibc.time_t
#endif
Proposed the fix to swift-nio-ssl: https://github.com/apple/swift-nio-ssl/pull/294
fixed in NIO
Reported via chat: