Support for Both Swift 5 and 6 in Package Builds #3138
-
Hi, I've updated my package to be Swift 6 compatible and adjusted the Obviously, the old Xcode does not contain the new Swift version specified in the project setting. I believe specifying Could you advise on how to configure the package to support both Swift 5 and 6 seamlessly, or suggest any tools that might help? Thank you for your assistance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I believe you'd either have to add a |
Beta Was this translation helpful? Give feedback.
-
I guess you could also try |
Beta Was this translation helpful? Give feedback.
-
Thank you for your response. I will attempt to specify a version in the However, as detailed in the build results, the command utilized for the build appears to be:
This command employs the project scheme and settings defined within the Xcode project file to build the target. Given the error message "SWIFT_VERSION '6.0' is unsupported, supported versions are: 4.0, 4.2, 5.0. (in target 'Kingfisher' from project 'Kingfisher')", it seems to be a project settings issue. Could you please clarify how adjustments to the package file might influence this situation (If I am correct, if built with swift package manager, the project setting won't be used at all)?
And thanks for the comments. It is |
Beta Was this translation helpful? Give feedback.
I believe you should be able to set
SWIFT_VERSION
to5
via the scheme. If that's problematic for your current scheme, you could add another one and reference it via thescheme:
in.spi.yml
.Maybe this page here has some useful info? https://www.swift.org/migration/documentation/swift-6-concurrency-migration-guide/swift6mode/