Skip to content
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

Add an option to build the concurrency library for back deployment. #39051

Merged
merged 4 commits into from Aug 26, 2021

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Aug 25, 2021

Introduce an additional build product to build-script to build
back-deployable concurrency libraries. These libraries would need to
be embedded in apps deployed prior to macOS 12/iOS 15 to support
concurrency.

The built-script option --back-deploy-concurrency can be provided to
build these back-deployment libraries. They are built in addition to
the normal concurrency libraries, as a separate product that installs
into lib/swift-5.5/<platform> within the toolchain. The macro
SWIFT_CONCURRENCY_BACK_DEPLOYMENT is set when building the
concurrency library, so that we can adapt the implementation to older
OS's.

When building the back-deployment libraries, the compiler will
accept async functions and actors with earlier deployment
targets. In this case, the modules themselves will reflect the
earlier availability. Testing has been updated to work in
either configuration.

@DougGregor
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Collaborator

Build failed
Swift Test Linux Platform
Git Sha - ba148c219ec4d78e3b6f4c79a76c19c66166f3f2

@swift-ci
Copy link
Collaborator

Build failed
Swift Test OS X Platform
Git Sha - ba148c219ec4d78e3b6f4c79a76c19c66166f3f2

@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor
Copy link
Member Author

@swift-ci please build toolchain

@swift-ci
Copy link
Collaborator

macOS Toolchain
Download Toolchain
Git Sha - 78996a3736e24b866ac3c72a3a9976276d1751e6

Install command
tar -zxf swift-PR-39051-1097-osx.tar.gz --directory ~/

@DougGregor DougGregor force-pushed the concurrency-back-deploy-libraries branch from 78996a3 to 507d4d4 Compare August 26, 2021 15:42
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

Introduce an additional build product to build-script to build
back-deployable concurrency libraries. These libraries would need to
be embedded in apps deployed prior to macOS 12/iOS 15 to support
concurrency.

The built-script option `--back-deploy-concurrency` can be provided to
build these back-deployment libraries. They are built in addition to
the normal concurrency libraries, as a separate product that installs
into `lib/swift-5.5/<platform>` within the toolchain. The macro
`SWIFT_CONCURRENCY_BACK_DEPLOYMENT` is set when building the
concurrency library, so that we can adapt the implementation to older
OS's.
…yment.

When enabling the build of the back-deployable concurrency library via
the build-script option `--back-deploy-concurrency`, also build the
compiler and (main) concurrency library to support older deployment targets.

Building the compiler for older deployment targets is effectively the
same as implicitly passing
`-Xfrontend -enable-experimental-back-deploy-concurrency`. That option
should probably go away.

Building the primary _Concurrency library for back-deployment means
setting the "SwiftStdlib 5.5" availability back to the earlier
deployment targets. This should have no effect on how the _Concurrency
library binary is built, but it does ensure that the right
availability annotations are in the _Concurrency module.
…ncy.

When build-script is given `--back-deploy-concurrency`, also use that
to build other parts of Swift with the back-deployed versions:

* The compiler allows async and actors to be defined with the
back-deployed availability, e.g., the same as `-Xfrontend
-enable-experimental-back-deploy-concurrency`. (The latter will go
away soon)
* The standard library unit testing framework and distributed actors
library are build with the older OS versions.
* The tests use the older OS versions, with some adjustments to make
them agnostic to the back-deployment setting.
@DougGregor DougGregor force-pushed the concurrency-back-deploy-libraries branch from 507d4d4 to ebd7b49 Compare August 26, 2021 15:49
@DougGregor
Copy link
Member Author

@swift-ci please test

@DougGregor DougGregor merged commit b6f6713 into apple:main Aug 26, 2021
@DougGregor DougGregor deleted the concurrency-back-deploy-libraries branch August 26, 2021 21:19
@cyupa
Copy link

cyupa commented Aug 27, 2021

Will this work with XCFrameworks as well? Will the library be included in the distributed frameworks?

@iSevenDays
Copy link

@swift-ci please build toolchain

@iSevenDays
Copy link

Is there a toolchain build, or is it planned to be included in the future Xcode versions?
I cannot use async for iOS 14, and I haven't found a way to build a toolchain on MacBook M1 with support for async/await concurrency in iOS 13-15.

@pronebird
Copy link

Is there any way to make it work on iOS 12 as well?

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.

None yet

5 participants