Skip to content
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
12 changes: 7 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ let settings: [SwiftSetting] = [
.define("EXPORT_SWIFTTLS"),
.define("IMPORT_CRYPTO"),
.define("SWIFTTLS_CERTIFICATE_VERIFICATION"),
// To support back to macOS 26, provide a shim on top of crypto APIs
// that allows passing spans. This is a less performant path, so for
// performance-sensitive cases, remove this define and require at least
// macOS 27.
.define("SHIM_CRYPTO_SPAN_APIS", .when(platforms: allApplePlatforms)),
.unsafeFlags(["-Xfrontend", "-experimental-spi-only-imports"]),
.enableExperimentalFeature("Lifetimes"),
.enableExperimentalFeature("AnyAppleOSAvailability"),
Expand Down Expand Up @@ -90,6 +85,13 @@ let package = Package(
name: "SignpostOutput",
description: "Enables `OSSignposter` output from the QUIC implementation."
),
// To support back to macOS 26, provide a shim on top of crypto APIs
// that allows passing spans is provided. This is a less performant path, so for
// performance-sensitive cases, pass in this trait to disable this shim.
.trait(
name: "DISABLE_SHIM_CRYPTO_SPAN_APIS",
description: "Disable backwards compatible crypto shim for performance sensitive cases"
),
.default(enabledTraits: []),
],
dependencies: [
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftNetwork/Utilities/CryptoWrappers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// Wrappers over older Crypto functions when span-based APIs are not available.
// This path exists for compatibility, but is significantly less efficient.

#if SHIM_CRYPTO_SPAN_APIS
#if !DISABLE_SHIM_CRYPTO_SPAN_APIS
#if canImport(Foundation)
import Foundation
#elseif canImport(SwiftSystem)
Expand Down
Loading