-
Notifications
You must be signed in to change notification settings - Fork 105
Add support for the libswiftCompatibilitySpan.dylib backward deployment library #642
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -313,9 +313,12 @@ public final class SDKVariant: PlatformInfoProvider, Sendable { | |
/// Minimum OS version for Swift-in-the-OS support. If this is `nil`, the platform does not support Swift-in-the-OS at all. | ||
public let minimumOSForSwiftInTheOS: Version? | ||
|
||
/// Minimum OS version for built-in Swift concurrency support. If this is `nil`, the platform does not support Swift concurrency at all. | ||
/// Minimum OS version for built-in Swift concurrency support (Swift 5.5). If this is `nil`, the platform does not support Swift concurrency at all. | ||
public let minimumOSForSwiftConcurrency: Version? | ||
|
||
/// Minimum OS version for built-in Swift Span support (Swift 6.2). If this is `nil`, the platform does not support Swift Span at all. | ||
public let minimumOSForSwiftSpan: Version? | ||
|
||
/// The path prefix under which all built content produced by this SDK variant should be installed, relative to the system root. | ||
/// | ||
/// Empty string if content should be installed directly into the system root (default). | ||
|
@@ -392,9 +395,10 @@ public final class SDKVariant: PlatformInfoProvider, Sendable { | |
|
||
self.clangRuntimeLibraryPlatformName = supportedTargetDict["ClangRuntimeLibraryPlatformName"]?.stringValue ?? Self.fallbackClangRuntimeLibraryPlatformName(variantName: name) | ||
|
||
let (os, concurrency) = Self.fallbackSwiftVersions(variantName: name) | ||
let (os, concurrency, span) = Self.fallbackSwiftVersions(variantName: name) | ||
self.minimumOSForSwiftInTheOS = try (supportedTargetDict["SwiftOSRuntimeMinimumDeploymentTarget"]?.stringValue ?? os).map { try Version($0) } | ||
self.minimumOSForSwiftConcurrency = try (supportedTargetDict["SwiftConcurrencyMinimumDeploymentTarget"]?.stringValue ?? concurrency).map { try Version($0) } | ||
self.minimumOSForSwiftSpan = try (supportedTargetDict["SwiftSpanMinimumDeploymentTarget"]?.stringValue ?? span).map { try Version($0) } | ||
|
||
self.systemPrefix = supportedTargetDict["SystemPrefix"]?.stringValue ?? { | ||
switch name { | ||
|
@@ -445,12 +449,12 @@ public final class SDKVariant: PlatformInfoProvider, Sendable { | |
} | ||
} | ||
|
||
private static func fallbackSwiftVersions(variantName name: String) -> (String?, String?) { | ||
private static func fallbackSwiftVersions(variantName name: String) -> (os: String?, concurrency: String?, span: String?) { | ||
switch name { | ||
case "macos", "macosx": | ||
return ("10.14.4", "12.0") | ||
return ("10.14.4", "12.0", "26.0") | ||
default: | ||
return (nil, nil) | ||
return (nil, nil, "26.0") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just remove the |
||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,6 +283,15 @@ extension Trait where Self == Testing.ConditionTrait { | |
}) | ||
} | ||
|
||
package static func requireXcode26(sourceLocation: SourceLocation = #_sourceLocation) -> Self { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The body of this function can just be implemented as |
||
enabled("Xcode version is not suitable", sourceLocation: sourceLocation, { | ||
guard let installedVersion = try? await InstalledXcode.currentlySelected().productBuildVersion() else { | ||
return true | ||
} | ||
return installedVersion > (try ProductBuildVersion("17A1")) | ||
}) | ||
} | ||
|
||
/// Constructs a condition trait that causes a test to be disabled if not running against at least the given version of Xcode. | ||
package static func requireMinimumXcodeBuildVersion(_ version: ProductBuildVersion, sourceLocation: SourceLocation = #_sourceLocation) -> Self { | ||
requireXcodeBuildVersions(in: version..., sourceLocation: sourceLocation) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why add default values for the arguments? This is only ever called in one place.