Skip to content

[CMake] Unbreak minimal Swift builds #36841

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
Apr 17, 2021
Merged

Conversation

davezarzycki
Copy link
Contributor

For various reasons, it can be useful/interesting to create builds of Swift that minimize dependencies. Let's try to keep that working as long as we can.

@davezarzycki davezarzycki requested a review from DougGregor April 9, 2021 10:39
@davezarzycki
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Apr 9, 2021

Build failed
Swift Test OS X Platform
Git Sha - cf0edf32b3f02f4a4ec55d451269d52625c9f4c0

@davezarzycki
Copy link
Contributor Author

Actually, this doesn't fix the test suite. I think the "right" fix is a CMake generated header file.

@swift-ci
Copy link
Contributor

swift-ci commented Apr 9, 2021

Build failed
Swift Test Linux Platform
Git Sha - cf0edf32b3f02f4a4ec55d451269d52625c9f4c0

@davezarzycki
Copy link
Contributor Author

@swift-ci please clean test

@swift-ci
Copy link
Contributor

swift-ci commented Apr 9, 2021

Build failed
Swift Test Linux Platform
Git Sha - a0e12142cfa9e14214542802a72bcddf0a24df44

@swift-ci
Copy link
Contributor

swift-ci commented Apr 9, 2021

Build failed
Swift Test OS X Platform
Git Sha - a0e12142cfa9e14214542802a72bcddf0a24df44

@davezarzycki
Copy link
Contributor Author

@swift-ci please smoke test

1 similar comment
@davezarzycki
Copy link
Contributor Author

@swift-ci please smoke test

@davezarzycki
Copy link
Contributor Author

@swift-ci please smoke test linux

@davezarzycki
Copy link
Contributor Author

Hi @DougGregor – What's the plan here? I see that the original pull request has been reverted but I'd imagine that you plan a second attempt at default importing the concurrency module, right?

@davezarzycki
Copy link
Contributor Author

Rebased on top of @DougGregor's second attempt.

@swift-ci please smoke test

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

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

This approach looks good! My apologies for breaking the minimal build

@@ -274,7 +274,8 @@ namespace swift {
bool EnableInferPublicSendable = false;

/// Disable the implicit import of the _Concurrency module.
bool DisableImplicitConcurrencyModuleImport = false;
bool DisableImplicitConcurrencyModuleImport =
!SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY;
Copy link
Member

Choose a reason for hiding this comment

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

Would it be easier to check SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY in shouldImportConcurrencyByDefault where we make the decision?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think it would be easier, and adjusting it in LangOpts makes the default match the build setup. Otherwise, I don't have a strong opinion about this. If people want to debate this in a subsequent pull request, that seems fine. I just want to unbreak minimum dependency builds.

For various reasons, it can be useful/interesting to create builds of
Swift that minimize dependencies. Let's try to keep that working as long
as we can.
@davezarzycki
Copy link
Contributor Author

@swift-ci please smoke test

@davezarzycki davezarzycki requested a review from etcwilde April 16, 2021 21:41
Copy link
Member

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

LGTM.

What is the rhyme and reason behind which tests get the -disable-implicit-concurrency-module-import? Is that just to ensure that this works correctly, or were those tests giving you trouble?

@davezarzycki
Copy link
Contributor Author

davezarzycki commented Apr 16, 2021

If concurrency is not essential to the test, then it's better to disable it to improve testing coverage on configurations with concurrency disabled.

@davezarzycki davezarzycki merged commit 80fe825 into swiftlang:main Apr 17, 2021
@davezarzycki davezarzycki deleted the pr36841 branch April 17, 2021 00:26
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