Skip to content

Fix Plugin Resolution #3858

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
merged 2 commits into from
Nov 15, 2021
Merged

Fix Plugin Resolution #3858

merged 2 commits into from
Nov 15, 2021

Conversation

SDGGiesbrecht
Copy link
Contributor

Spun out of #3838. This contains only the pieces related to fixing plugins, which contained bugs affecting both resolution modes.

I added two tests that are independent of the resolution mode, one to make sure plugin executables are usable even when they are not attached to any product (which was the primary thing broken), and the other to make sure that such executables are not accessible outside of the plugin itself.

To make the second test work even with legacy full resolution, I needed to explicitly block synthesized products from dependency links (in PackageGraph+Loading.swift). That should also make it more resilient during hypothetical future refactors, because it does not rely on the order of the loading process.

@abertelrud

@SDGGiesbrecht
Copy link
Contributor Author

The diff of the PackageBuilder.swift portion is much more legible under -w, because it is mostly indentation changes caused by the if statement moving.

@abertelrud
Copy link
Contributor

abertelrud commented Nov 11, 2021

Thanks a bunch for taking the time to split this out @SDGGiesbrecht! This looks good to me.

@abertelrud
Copy link
Contributor

@swift-ci please smoke test

@abertelrud
Copy link
Contributor

Note: We'll probably see some async-related failures in the Linux self hosted test due to unrelated reasons. Should clear up with a later toolchain, but shouldn't hold up merging this if everything else passes.

@abertelrud abertelrud self-assigned this Nov 11, 2021
@SDGGiesbrecht SDGGiesbrecht mentioned this pull request Nov 11, 2021
11 tasks
@abertelrud
Copy link
Contributor

@swift-ci please smoke test

@SDGGiesbrecht
Copy link
Contributor Author

Basics/Errors.swift:14: Fatal error: unknown checkout state sourceControl

Is that what #3865 is about?

@tomerd
Copy link
Contributor

tomerd commented Nov 12, 2021

Is that what #3865 is about?

yes

@tomerd
Copy link
Contributor

tomerd commented Nov 12, 2021

@swift-ci please smoke test linux

@abertelrud
Copy link
Contributor

I did some extra testing on this, and it seems to work great, also in a client of libSwiftPM. Thanks @SDGGiesbrecht.

@abertelrud abertelrud merged commit cdc2e95 into swiftlang:main Nov 15, 2021
@SDGGiesbrecht SDGGiesbrecht deleted the plugin branch November 15, 2021 19:44
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.

4 participants