Skip to content

Separate CMake option for "build concurrency lib" and "import concurrency lib" #37686

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

Conversation

DougGregor
Copy link
Member

The CMake option SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY was originally
meant to imply that we should build the _Concurrency module, which it still
does. However, to support minimal stdlib builds, it also became a way
to configure the compiler to avoid implicitly importing the
_Concurrency module. However, we build configurations of Swift where
we want the implicit import but don't want to build the _Concurrency
library. Use a new, different option
(SWIFT_IMPLICIT_CONCURRENCY_IMPORT) for the "implicit import"
behavior within the compiler, which defaults to "true", and disable
that for minimal stdlib builds.

Fixes rdar://78544947.

…ency lib"

The CMake option `SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY` was originally
meant to imply that we should build the _Concurrency module, which it still
does. However, to support minimal stdlib builds, it also became a way
to configure the compiler to avoid implicitly importing the
_Concurrency module. However, we build configurations of Swift where
we want the implicit import but don't want to build the _Concurrency
library. Use a new, different option
(`SWIFT_IMPLICIT_CONCURRENCY_IMPORT`) for the "implicit import"
behavior within the compiler, which defaults to "true", and disable
that for minimal stdlib builds.

Fixes rdar://78544947.
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@davezarzycki will this work for the minimal stdlib for you? It helps with our build-the-compiler-without-the-extra-libraries builds.

@DougGregor DougGregor requested a review from edymtt May 28, 2021 04:42
@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4c1c8ed

@davezarzycki
Copy link
Contributor

Seems reasonable to me.

@DougGregor
Copy link
Member Author

macOS test timed out but otherwise didn't fail. Dropping down to smoke tests

@DougGregor
Copy link
Member Author

@swift-ci please smoke test macOS

@DougGregor DougGregor merged commit 1a07733 into swiftlang:main May 28, 2021
@DougGregor DougGregor deleted the minimal-stdlib-concurrency-fix branch May 28, 2021 16:25
3405691582 added a commit to 3405691582/swift that referenced this pull request Jun 10, 2021
In swiftlang#37686 `SWIFT_IMPLICIT_CONCURRENCY_IMPORT` was introduced alongside
the existing `SWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY`, but the
`#cmakedefine` for this preprocessor symbol was renamed to the former
instead of a new `#cmakedefine` being introduced.

This means the `#ifdef` conditional referred in this commit was broken.
Instead of just introducing the old symbol back again, let's rename it
as it probably was intended here.

However, the semantics of this symbol is slightly different: this now
requires prospective builders to explicitly turn this off on platforms
where Dispatch is unavailable. To address this, the docs are updated to
match. Caveat: I have not ran the procedure in the doc recently, but
this hopefully should suffice to guide the reader until I get around to
doing so.
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.

3 participants