-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add (partial) support for building on Windows using SwiftPM #7866
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
Conversation
@swift-ci test |
The macOS CI is still using Swift 5.9. Is this expected or should I bump down the tools version in swift-toolchain-sqlite from 5.10 to 5.9? |
@swift-ci please test Windows |
@swift-ci please test macOS |
I'd prefer just bumping down for now. We should separately test bumping |
@@ -854,7 +856,8 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil { | |||
.package(url: "https://github.com/swiftlang/swift-syntax.git", branch: relatedDependenciesBranch), | |||
.package(url: "https://github.com/apple/swift-system.git", "1.1.1" ..< "1.4.0"), | |||
.package(url: "https://github.com/apple/swift-collections.git", "1.0.1" ..< "1.2.0"), | |||
.package(url: "https://github.com/apple/swift-certificates.git", "1.0.1" ..< "1.4.0"), | |||
.package(url: "https://github.com/apple/swift-certificates.git", "1.0.1" ..< "1.6.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.
Needed to pull in apple/swift-certificates#180 which fixes a Windows build break
This adds a dependency on the new swift-toolchain-sqlite package, which allows swift-package-manager to build using swift build on Windows (including tests) without any additional flags or preinstalled dependencies. It's "partial" because there is still one final blocker, which is that linking fails because we exceed the 65k exported symbol limit due to limitations in the build system, which can be addressed separately.
ddb2fbb
to
6af499a
Compare
@swift-ci please test |
@swift-ci please test windows |
This continues from the support added in #7866. While we can't build on Windows as-is due to exceeding the 65k exported symbol limit, in turn due to limitations in the build system, we can apply -static to all of the library targets which are known to be linked statically, in order to get that symbol count down. Note that this uses unsafeFlags, which is normally not recommended, however given that we are already using unsafeFlags elsewhere in the manifest, this seems reasonable enough for now until we can improve support for static linking on Windows. Building the test targets still exceeds the symbol count though.
This continues from the support added in #7866. While we can't build on Windows as-is due to exceeding the 65k exported symbol limit, in turn due to limitations in the build system, we can apply -static to all of the library targets which are known to be linked statically, in order to get that symbol count down. Note that this uses unsafeFlags, which is normally not recommended, however given that we are already using unsafeFlags elsewhere in the manifest, this seems reasonable enough for now until we can improve support for static linking on Windows. Building the test targets still exceeds the symbol count though.
This adds a dependency on the new swift-toolchain-sqlite package, which allows swift-package-manager to build using swift build on Windows (including tests) without any additional flags or preinstalled dependencies.
It's "partial" because there is still one final blocker, which is that linking fails because we exceed the 65k exported symbol limit due to limitations in the build system, which can be addressed separately.