Skip to content

[5.5] Build PackageDescription and PackagePlugin universal on macOS platform #3536

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Conversation

abertelrud
Copy link
Contributor

@abertelrud abertelrud commented Jun 7, 2021

This is the 5.5 cherry-pick of a sequence of changes to build PackageDescription and PackagePlugin universal on macOS platform. SwiftPM switches to the XCBuild build system when building universal, and this PR includes the necessary follow-up changes to make that work.

This includes 5.5 cherry-picks of the changes in:

#3431
#3526
#3528

each as a separate commit containing the original commit hash from which it was cherry-picked.

This PR builds on top of the PR #3492, which is kept as a separate PR since it is for a different issue.

The three are put up as one PR since they all are steps toward fixing the same issue.

@abertelrud abertelrud changed the base branch from main to release/5.5 June 7, 2021 22:19
@abertelrud abertelrud self-assigned this Jun 7, 2021
@abertelrud abertelrud added 5.5 ready Author believes the PR is ready to be merged & any feedback has been addressed labels Jun 7, 2021
@abertelrud
Copy link
Contributor Author

@swift-ci please test

…lugin libraries universal when cross-compiling.

Also unify and clean up some of the logic by making the helper function that installs libSwiftPM be more generic, and also apply to PackageDescription and PackagePlugin.

rdar://75186958

(cherry picked from commit 637fa7a)
…d PackagePlugin on macOS

Because PackageDescription unintentionally exports Foundation (for which a fix was attempted but then reverted after it broke some packages), we can only enable library evolution on Darwin platforms.

rdar://78827075

(cherry picked from commit 6e7bb87)
…brary evolution via unsafe flags

There isn't currently a way for package authors to enable library evolution or module interfaces from the package manifest.  They can pass `-enable-library-evolution` in their unsafe flags, but because `-emit-module-interface` requires a path parameter, it isn't something that can be set in the manifest.

This adds a way to infer XCBuild settings based on values set in manifest-declared settings.  The idea is to implement semantics appropriately for each platform based on generalized flags passed from the manifest.

rdar://78773077

(cherry picked from commit 4569c7f)
@abertelrud abertelrud force-pushed the eng/build-pkgdescription-and-pkgplugin-universal-5.5 branch from 6182815 to 0e85e74 Compare June 25, 2021 01:09
@abertelrud
Copy link
Contributor Author

@swift-ci please smoke test

@abertelrud
Copy link
Contributor Author

@swift-ci please test

…ries, since these should not be part of the installed toolchain.

(cherry picked from commit 3741792)
@abertelrud
Copy link
Contributor Author

@swift-ci please test

@abertelrud
Copy link
Contributor Author

@swift-ci please test linux

@finagolfin
Copy link
Member

Anything holding this up? My cross-compilation pull #3577 relies on this pull to cross-compile these libraries.

@abertelrud
Copy link
Contributor Author

Anything holding this up? My cross-compilation pull #3577 relies on this pull to cross-compile these libraries.

No, it looks like this has all the necessary approvals. Merging.

@abertelrud abertelrud merged commit 0a2ac74 into swiftlang:release/5.5 Jul 6, 2021
@abertelrud abertelrud deleted the eng/build-pkgdescription-and-pkgplugin-universal-5.5 branch July 6, 2021 17:06
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
ready Author believes the PR is ready to be merged & any feedback has been addressed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants