-
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?
Conversation
A couple of related fixes: * Use 26.0 as the fallback version number when SDKSettings doesn't include SwiftSpanMinimumDeploymentTarget * Update tests to expect `--back-deploy-swift-span` and check when it shouldn't be there
@swift-ci please test |
Provided by Owen Voorhees
@swift-ci please test |
Note that we need this in Also, @slavapestov opened a PR for this a couple months ago (#359), I guess we should close that one now. |
Ah, I can replace this with one that targets release/6.2. Didn't realize that's how swift-build is handling branching. |
@@ -287,6 +295,29 @@ extension Platform { | |||
|
|||
return version >= minimumSwiftConcurrencyVersion | |||
} | |||
|
|||
/// Determines if the platform natively supports Swift 6.2's Span type. If `false`, then the Swift Span back-compat lib needs to be copied into the app/framework's bundle. | |||
public func supportsSwiftSpanNatively(_ scope: MacroEvaluationScope, forceNextMajorVersion: Bool = false, considerTargetDeviceOSVersion: Bool = true) -> Bool? { |
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.
default: | ||
return (nil, nil) | ||
return (nil, nil, "26.0") |
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.
Just remove the case "macos", "macosx"
now; that was a compatibility polyfill and isn't needed anymore.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
The body of this function can just be implemented as requireMinimumXcodeBuildVersion("17A1", sourceLocation: sourceLocation)
Yeah, we have a custom job set up... bit different from the rest of swiftlang. FYI, you can just change the PR's target branch and force push without needing to open a new PR. |
The Windows failures:
...look like STATUS_DLL_NOT_FOUND, meaning the binary that's running is failing to find some dependent DLL. |
The Swift library
libswiftCompatibilitySpan.dylib
allows uses ofSpan
,MutableSpan
, etc. to deploy to earlier OS versions. Detect when it is needed and copy it into the build artifact.