Skip to content

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

Merged
merged 2 commits into from
Feb 23, 2024

Conversation

MaxDesiatov
Copy link
Contributor

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.

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.
@MaxDesiatov MaxDesiatov added enhancement build system Changes to interactions with build systems dependencies Changes to dependencies and relevant checks cmake Changes related to CMake configuration labels Feb 22, 2024
@MaxDesiatov MaxDesiatov self-assigned this Feb 22, 2024
@MaxDesiatov MaxDesiatov requested a review from compnerd February 22, 2024 15:15
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@@ -330,6 +334,9 @@ struct SwiftBootstrapBuildTool: ParsableCommand {
fileSystem: self.fileSystem,
observabilityScope: self.observabilityScope
)
#else
fatalError("SwiftPM was built without XCBuild support")
Copy link
Contributor Author

@MaxDesiatov MaxDesiatov Feb 22, 2024

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.

Copy link
Contributor

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

Copy link
Contributor

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
    }

Copy link
Member

@compnerd compnerd left a 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.

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) February 22, 2024 17:06
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

2 similar comments
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov merged commit 5287062 into main Feb 23, 2024
@MaxDesiatov MaxDesiatov deleted the maxd/skip-cmake-xcbuild branch February 23, 2024 13:29
bnbarham added a commit to bnbarham/swift-package-manager that referenced this pull request Feb 27, 2024
…7358)"

This reverts commit 5287062, which
causes macOS toolchain builds to fail with:
```
main/main.swift:345: Fatal error: SwiftPM was built without XCBuild support
```
bnbarham added a commit to bnbarham/swift-package-manager that referenced this pull request Feb 27, 2024
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.
MaxDesiatov pushed a commit that referenced this pull request Feb 27, 2024
…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).
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
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.
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
…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).
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
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.
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system Changes to interactions with build systems cmake Changes related to CMake configuration dependencies Changes to dependencies and relevant checks enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants