Skip to content

Commit

Permalink
Fix build on all platforms (#185)
Browse files Browse the repository at this point in the history
Motivation:

It turns out that #183 broke the build on a number of platforms,
including Linux 6.1+, Android 6.1+, and on 6.0 macOS. We need to keep
things building.

Modifications:

Guard the import of CDispatch
Remove the use of replacingOccurrences

Result:

Better builds.
  • Loading branch information
Lukasa authored Dec 16, 2024
1 parent 40b9442 commit 13a096f
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions Sources/NIOSSH/Keys And Signatures/NIOSSHCertifiedPublicKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@
//
//===----------------------------------------------------------------------===//

import CDispatch
import Crypto
import Dispatch
import NIOCore

#if canImport(CDispatch)
import CDispatch
#endif

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
Expand Down Expand Up @@ -393,22 +396,13 @@ extension NIOSSHCertifiedPublicKey: Hashable {}

extension NIOSSHCertifiedPublicKey: CustomDebugStringConvertible {
public var debugDescription: String {
"""
NIOSSHCertifiedPublicKey(
nonce: \(self.nonce),
serial: \(self.serial),
type: \(self.type),
key: \(self.key),
keyID: \(self.keyID),
validPrincipals: \(self.validPrincipals),
validAfter: \(self.validAfter),
validBefore: \(self.validBefore),
criticalOptions: \(self.criticalOptions),
extensions: \(self.extensions),
signatureKey: \(self.signatureKey),
signature: \(self.signature)
)
""".replacingOccurrences(of: "\n", with: "")
// Slightly hacky multiline string to try to keep things
// clear.
"NIOSSHCertifiedPublicKey(nonce: \(self.nonce), serial: \(self.serial), type: \(self.type), "
+ "key: \(self.key), keyID: \(self.keyID), validPrincipals: \(self.validPrincipals), "
+ "validAfter: \(self.validAfter), validBefore: \(self.validBefore), "
+ "criticalOptions: \(self.criticalOptions), extensions: \(self.extensions), "
+ "signatureKey: \(self.signatureKey), signature: \(self.signature))"
}
}

Expand Down

0 comments on commit 13a096f

Please sign in to comment.