Skip to content

A few fixes for building SwiftPM for MacCatalyst #6414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/Basics/Cancellator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public final class Cancellator: Cancellable {
// Terminate all processes on receiving an interrupt signal.
try? self?.cancel(deadline: .now() + .seconds(30))

#if os(macOS) || os(OpenBSD)
#if os(macOS) || targetEnvironment(macCatalyst) || os(OpenBSD)
// Install the default signal handler.
var action = sigaction()
action.__sigaction_u.__sa_handler = SIG_DFL
Expand Down
2 changes: 1 addition & 1 deletion Sources/swiftpm-xctest-helper/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ do {

#if os(Windows)
import func ucrt.exit
#else
#elseif canImport(Glibc)
import func Glibc.exit
#endif
print("Only macOS supported.")
Expand Down
4 changes: 3 additions & 1 deletion Tests/PackageCollectionsSigningTests/Utilities.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ struct TestCertificatePolicy: CertificatePolicy {
#if os(macOS)
self.verify(certChain: certChain, anchorCerts: self.anchorCerts, verifyDate: self.verifyDate,
callbackQueue: callbackQueue, callback: callback)
#else
#elseif os(Linux) || os(Windows) || os(Android)
self.verify(certChain: certChain, anchorCerts: self.anchorCerts, verifyDate: self.verifyDate, httpClient: nil,
observabilityScope: ObservabilitySystem.NOOP,
callbackQueue: callbackQueue, callback: callback)
#else
throw InternalError("not implemented")
#endif
} catch {
return callbackQueue.async { callback(.failure(error)) }
Expand Down