Skip to content

[CMake] Formalize whether libdispatch is used/allowed #35939

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 1 commit into from
Feb 13, 2021

Conversation

davezarzycki
Copy link
Contributor

Accidentally requiring libdispatch is a repeated cmake regression. Let's avoid this entirely by formalizing whether libdispatch is enabled or not rather than infer it.

@davezarzycki
Copy link
Contributor Author

@swift-ci please test

@davezarzycki
Copy link
Contributor Author

@buttaface – I think I've addressed your concerns. Feedback would be appreciated.

@swift-ci please test

Copy link
Member

@finagolfin finagolfin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work simplifying the logic.

@davezarzycki davezarzycki requested a review from drexin February 12, 2021 15:06
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.

This effectively disables the use of SWIFT_BUILD_SYNTAXPARSERLIB and SWIFT_BUILD_SOURCEKIT if SWIFT_ENABLE_DISPATCH is false. I think that if you want to expose the explicit control over dispatch, please use cmake_dependent_option to ensure that the user cannot set SWIFT_BUILD_SYNTAXPARSERLIB or SWIFT_BUILD_SOURCEKIT while SWIFT_ENABLE_DISPATCH is a false value.

@davezarzycki
Copy link
Contributor Author

@compnerd – Thanks for the feedback. The patch now uses cmake_dependent_option.

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 81b6acaabf1e9f320467c4fc7883716364776ab2

@davezarzycki
Copy link
Contributor Author

Hey @compnerd – It looks like that CMake feature is too new. From one of the Linux builders:

12:34:19 CMake Error at CMakeLists.txt:413 (cmake_dependent_option):
12:34:19   Unknown CMake command "cmake_dependent_option".

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 81b6acaabf1e9f320467c4fc7883716364776ab2

@compnerd
Copy link
Member

@davezarzycki I suspect you missed the include(CMakeDependentOption) which actually is required. The feature has been there for a very long time (3.13 at the very least).

Accidentally requiring libdispatch is a repeated cmake regression. Let's
avoid this entirely by formalizing whether libdispatch is enabled or not
rather than infer it.
@davezarzycki
Copy link
Contributor Author

@compnerd – Ah that must be it. Fixed.

@swift-ci please test

@compnerd
Copy link
Member

@swift-ci please test Windows platform

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.

I think that this shouldn't change the default behaviour and still allow control over dispatch and validate inputs, so seems reasonable. Please ensure that it passes the Windows CI as well (though I don't see why it wouldn't).

@davezarzycki davezarzycki merged commit 7017362 into swiftlang:main Feb 13, 2021
@davezarzycki davezarzycki deleted the pr35939 branch February 13, 2021 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants