Skip to content

[5.5] Unify the two versions of PackageDescription into a single one using availability annotations instead of compile conditionals #3492

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

Conversation

abertelrud
Copy link
Contributor

This is a SwiftPM 5.5 nomination of #3464. Some of the fixes we still want to do in 5.5 (such as building the toolchains with universal binaries for PackageDescription and PackagePlugin on Darwin) require this change (since SwiftPM cannot currently build the same target in two different ways, i.e. cannot product a 4.0 and 4.2 PackageDescription).

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

@swift-ci please test

@abertelrud abertelrud force-pushed the eng/unified-package-description-5.5 branch from 45094d3 to 66e4f80 Compare June 7, 2021 21:18
…using availability annotations instead of #if

Unify PackageDescription 4.0 and 4.2+ into a single library by using availability annotations instead of #if

Replace the compile-time conditionals in PackageDescription with availability annotations.  This lets us build a single PackageDescription, which will make the build scripts easier (with the goal of being able to build it entirely from the package itself).

As part of this we also clean up the runtime library subdirectories.  Until now we've had PackagePlugin directly in the runtime library directory, and PackageDescription under subdirectories called "4" and "4_2".  This has sufficed in keeping PackageDescription and PackagePlugin in separate directories (so that a manifest or plugin script can't import both).

This needs to be changed now that there is only one version of a PackageDescription, and anyway it's time to clean this up.  So as part of this we also establish two subdirectories for the runtime APIs: "ManifestAPI" and "PluginAPI".  If we add more kinds of scripts, we can then add new subdirectories here.

rdar://77441062

(cherry picked from 2d2b387)
@abertelrud abertelrud force-pushed the eng/unified-package-description-5.5 branch from 66e4f80 to 6c70d17 Compare June 7, 2021 22:09
@abertelrud
Copy link
Contributor Author

This PR has been up for a long time, so I rebased on the latest release/5.5 branch, and also updated the commit description to include the [5.5] prefix and the SHA of the original commit.

@abertelrud
Copy link
Contributor Author

@swift-ci please test

@abertelrud abertelrud merged commit d875e4f into swiftlang:release/5.5 Jun 13, 2021
@abertelrud abertelrud deleted the eng/unified-package-description-5.5 branch June 13, 2021 20:27
abertelrud added a commit to abertelrud/swift-package-manager that referenced this pull request Jun 15, 2021
…a single library by using availability annotations instead of #if (swiftlang#3492)"

This caused the Windows toolchains to break, so this temporarily reverts the change until the installer can be adjusted.

This reverts commit d875e4f.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

2 participants