-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Exclude XCBuildSupport
when building with CMake
#7358
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
XCBuildSupport is not available on non-Darwin platforms, especially Windows, where we have to have full CMake support at the moment. Maintaining XCBuildSupport in these unsupported configurations adds unnecessary overhead, especially in cases like #7258, where we have to add new dependencies only when `XCBuildSupport` is available. We should exclude from CMake builds to reduce this maintenance overhead.
@swift-ci test |
@@ -330,6 +334,9 @@ struct SwiftBootstrapBuildTool: ParsableCommand { | |||
fileSystem: self.fileSystem, | |||
observabilityScope: self.observabilityScope | |||
) | |||
#else | |||
fatalError("SwiftPM was built without XCBuild support") |
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.
This line is technically unreachable, since case .xcode
is never reachable on non-Darwin platforms, and we don't call swift-bootstrap --build-system xcode
anywhere during the build process on Darwin.
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.
This line is technically unreachable
Heh, famous last words:
https://ci.swift.org/job/oss-swift-package-macos/2753
--- bootstrap: note: Building SwiftPM (with a freshly built swift-bootstrap)
main/main.swift:345: Fatal error: SwiftPM was built without XCBuild support
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.
bootstrap/bin/swift-bootstrap ... --arch x86_64 --arch arm64 ...
And:
private var buildSystem: BuildSystemProvider.Kind {
#if os(macOS)
// Force the Xcode build system if we want to build more than one arch.
return self.architectures.count > 1 ? .xcode : .native
#else
// Force building with the native build system on other platforms than macOS.
return .native
#endif
}
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.
Thanks! This seems like a good idea to me.
@swift-ci test |
@swift-ci test windows |
This was added to the `Package.swift` in swiftlang#7258 but skipped in the CMake because swiftlang#7358 excluded XCBuildSupport as a CMake target. But that's reverted here, so we need to add the dependency in.
…7371) This reverts commit 5287062, which causes macOS toolchain builds to fail with: ``` main/main.swift:345: Fatal error: SwiftPM was built without XCBuild support ``` Also adds the DriverSupport dependency to XCBuildSupport, which was skipped in #7258 because #7358 was merged (but we're reverting that).
XCBuildSupport is not available on non-Darwin platforms, especially Windows, where we have to have full CMake support at the moment. Maintaining XCBuildSupport in these unsupported configurations adds unnecessary overhead, especially in cases like swiftlang#7258, where we have to add new dependencies only when `XCBuildSupport` is available. We should exclude from CMake builds to reduce this maintenance overhead.
…7358)" (swiftlang#7371) This reverts commit 5287062, which causes macOS toolchain builds to fail with: ``` main/main.swift:345: Fatal error: SwiftPM was built without XCBuild support ``` Also adds the DriverSupport dependency to XCBuildSupport, which was skipped in swiftlang#7258 because swiftlang#7358 was merged (but we're reverting that).
XCBuildSupport is not available on non-Darwin platforms, especially Windows, where we have to have full CMake support at the moment. Maintaining XCBuildSupport in these unsupported configurations adds unnecessary overhead, especially in cases like swiftlang#7258, where we have to add new dependencies only when `XCBuildSupport` is available. We should exclude from CMake builds to reduce this maintenance overhead.
…7358)" (swiftlang#7371) This reverts commit 5287062, which causes macOS toolchain builds to fail with: ``` main/main.swift:345: Fatal error: SwiftPM was built without XCBuild support ``` Also adds the DriverSupport dependency to XCBuildSupport, which was skipped in swiftlang#7258 because swiftlang#7358 was merged (but we're reverting that).
XCBuildSupport is not available on non-Darwin platforms, especially Windows, where we have to have full CMake support at the moment. Maintaining XCBuildSupport in these unsupported configurations adds unnecessary overhead, especially in cases like #7258, where we have to add new dependencies only when
XCBuildSupport
is available. We should exclude from CMake builds to reduce this maintenance overhead.