Skip to content

Provide libSwiftPM API to allow plugins to be compiled before they are invoked #3841

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

abertelrud
Copy link
Contributor

@abertelrud abertelrud commented Nov 8, 2021

Split out compilation of package plugins so it can be done separately from invoking them (typically for collecting diagnostics up-front) and add a PluginCompilationResult type that can be returned to clients.

Motivation:

This allows libSwiftPM clients (and at some point the SwiftPM CLI) to compile plugins separately from running them.

Modifications:

  • mark the compilation function public and clean it up a bit while changing it
  • add a struct for returning the results of compiling the plugin (including path to .dia file)
  • add a unit test for this functionality

@abertelrud abertelrud marked this pull request as draft November 8, 2021 22:44
@abertelrud abertelrud self-assigned this Nov 8, 2021
@abertelrud abertelrud added the WIP Work in progress label Nov 8, 2021
… from invoking them (typically for collecting diagnostics up-front) and add a `PluginCompilationResult` type that can be returned to clients.
@abertelrud abertelrud force-pushed the eng/pass-back-compilation-result branch from 6376f3c to 6cfecaf Compare November 10, 2021 20:44
@abertelrud abertelrud marked this pull request as ready for review November 10, 2021 20:49
@abertelrud abertelrud requested a review from elsh as a code owner November 10, 2021 20:49
@abertelrud
Copy link
Contributor Author

@swift-ci please smoke test

@abertelrud
Copy link
Contributor Author

The AsyncPackageTests are failing on Linux...

@abertelrud
Copy link
Contributor Author

The AsyncPackageTests are failing on Linux...

@briancroom This looks related to #3844?

@briancroom
Copy link
Contributor

The AsyncPackageTests are failing on Linux...

@briancroom This looks related to #3844?

Yes, that’s right. See discussion:
#3844 (comment)
#3844 (comment)

@abertelrud
Copy link
Contributor Author

abertelrud commented Nov 11, 2021

The AsyncPackageTests are failing on Linux...

@briancroom This looks related to #3844?

Yes, that’s right. See discussion: #3844 (comment) #3844 (comment)

Thanks, Brian! Sorry, missed those comments. So that failure alone shouldn't block merging this? (to be clear this PR is still a work in progress, but hopefully soon won't be)

@abertelrud
Copy link
Contributor Author

The AsyncPackageTests are failing on Linux...

@briancroom This looks related to #3844?

Yes, that’s right. See discussion: #3844 (comment) #3844 (comment)

Thanks, Brian! Sorry, missed those comments. So that failure alone shouldn't block merging this? (to be clear this PR is still a work in progress, but hopefully soon won't be)

Actually I forgot that I added the unit test already to this PR, so it's ready.

@abertelrud abertelrud added ready Author believes the PR is ready to be merged & any feedback has been addressed and removed WIP Work in progress labels Nov 11, 2021
@abertelrud
Copy link
Contributor Author

The failure in the self-hosted test on Linux is known and unrelated (see comments above) and should be resolved when a newer toolchain is used by CI.

@abertelrud abertelrud merged commit 442f20e into swiftlang:main Nov 11, 2021
@abertelrud abertelrud changed the title WIP: Provide libSwiftPM API to allow plugins to be compiled before they are invoked Provide libSwiftPM API to allow plugins to be compiled before they are invoked Nov 11, 2021
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.

3 participants