Socket icon indicating copy to clipboard operation
Socket copied to clipboard

Defensively unify CSocket imports

Open gregcotten opened this issue 10 months ago • 2 comments

Compiling with Swift 6.1 on Linux fails with stuff like

/swift-bundler/.build/checkouts/Socket/Sources/Socket/System/Constants.swift:372:50: error: cannot find 'SOCK_STREAM' in scope

@_alwaysEmitIntoClient
internal var _SOCK_STREAM: CInterop.SocketType { SOCK_STREAM }
                                                 `- error: cannot find 'SOCK_STREAM' in scope

@_alwaysEmitIntoClient

/swift-bundler/.build/checkouts/Socket/Sources/Socket/System/Constants.swift:375:49: error: cannot find 'SOCK_DGRAM' in scope

@_alwaysEmitIntoClient
internal var _SOCK_DGRAM: CInterop.SocketType { SOCK_DGRAM }
                                                `- error: cannot find 'SOCK_DGRAM' in scope

@_alwaysEmitIntoClient

/swift-bundler/.build/checkouts/Socket/Sources/Socket/System/Constants.swift:378:47: error: cannot find 'SOCK_RAW' in scope

@_alwaysEmitIntoClient
internal var _SOCK_RAW: CInterop.SocketType { SOCK_RAW }
                                              `- error: cannot find 'SOCK_RAW' in scope

@_alwaysEmitIntoClient

/swift-bundler/.build/checkouts/Socket/Sources/Socket/System/Constants.swift:381:47: error: cannot find 'SOCK_RDM' in scope

@_alwaysEmitIntoClient
internal var _SOCK_RDM: CInterop.SocketType { SOCK_RDM }
                                              `- error: cannot find 'SOCK_RDM' in scope

@_alwaysEmitIntoClient

/swift-bundler/.build/checkouts/Socket/Sources/Socket/System/Constants.swift:384:53: error: cannot find 'SOCK_SEQPACKET' in scope

@_alwaysEmitIntoClient
internal var _SOCK_SEQPACKET: CInterop.SocketType { SOCK_SEQPACKET }
                                                    `- error: cannot find 'SOCK_SEQPACKET' in scope

#if os(Linux)

/swift-bundler/.build/checkouts/Socket/Sources/Socket/System/Constants.swift:388:48: error: cannot find 'SOCK_DCCP' in scope
#if os(Linux)
@_alwaysEmitIntoClient
internal var _SOCK_DCCP: CInterop.SocketType { SOCK_DCCP }
                                               `- error: cannot find 'SOCK_DCCP' in scope

@_alwaysEmitIntoClient

/swift-bundler/.build/checkouts/Socket/Sources/Socket/System/Constants.swift:391:52: error: cannot find 'SOCK_NONBLOCK' in scope

@_alwaysEmitIntoClient
internal var _SOCK_NONBLOCK: CInterop.SocketType { SOCK_NONBLOCK }
                                                   `- error: cannot find 'SOCK_NONBLOCK' in scope

@_alwaysEmitIntoClient

/swift-bundler/.build/checkouts/Socket/Sources/Socket/System/Constants.swift:394:51: error: cannot find 'SOCK_CLOEXEC' in scope

@_alwaysEmitIntoClient
internal var _SOCK_CLOEXEC: CInterop.SocketType { SOCK_CLOEXEC }
                                                  `- error: cannot find 'SOCK_CLOEXEC' in scope
#endif

gregcotten avatar Mar 06 '25 00:03 gregcotten

care to pull these changes in?

gregcotten avatar Apr 03 '25 22:04 gregcotten

@colemancda, now that Swift 6.1 is generally available, anyone trying to use this package on Linux will be met with these build errors!

gregcotten avatar Apr 03 '25 22:04 gregcotten

Sorry, just seeing this. I happened to fix this myself.

colemancda avatar Jul 07 '25 13:07 colemancda