Skip to content

Unable to cross compiling against MUSL. #170

@zaneenders

Description

@zaneenders

SwiftNIO SSH commit hash: e0ad5be

Context:

Trying to compile swift-nio-ssh against MUSL getting the following errors.

/Users/zane/Downloads/swift-nio-ssh/Sources/NIOSSH/Keys And Signatures/NIOSSHCertifiedPublicKey.swift:740:17: error: cannot find 'timespec' in scope
738 | extension DispatchWallTime {
739 |     init(secondsSinceEpoch: UInt64) {
740 |         let t = timespec(tv_sec: time_t(secondsSinceEpoch), tv_nsec: 0)
    |                 `- error: cannot find 'timespec' in scope
741 |         self = DispatchWallTime(timespec: t)
742 |     }

/Users/zane/Downloads/swift-nio-ssh/Sources/NIOSSH/Keys And Signatures/NIOSSHCertifiedPublicKey.swift:740:34: error: cannot find 'time_t' in scope
738 | extension DispatchWallTime {
739 |     init(secondsSinceEpoch: UInt64) {
740 |         let t = timespec(tv_sec: time_t(secondsSinceEpoch), tv_nsec: 0)
    |                                  `- error: cannot find 'time_t' in scope
741 |         self = DispatchWallTime(timespec: t)
742 |     }

Steps to reproduce:

xcrun --toolchain swift swift build --swift-sdk aarch64-swift-linux-musl
# or 
xcrun --toolchain swift swift build --swift-sdk x86_64-swift-linux-musl

Environment

xcrun --toolchain swift swift --version
Apple Swift version 6.0.1 (swift-6.0.1-RELEASE)
Target: arm64-apple-macosx15.0

xcrun --toolchain swift swift sdk list
swift-6.0.1-RELEASE_static-linux-0.0.1

Operating system: 15.0 (24A335)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions