Add support to PIF builder for executable product aliasing for plugin tools#10136
Merged
cmcgee1024 merged 2 commits intoMay 28, 2026
Merged
Conversation
… tools (swiftlang#10107) Executable targets are automatically promoted as products with the same name. They can also be named differently using an explicit product that depends on the executable target. When declaring a plugin in the same package as an executable used as a plugin tool the package manifest requires that the dependency be on the executable target and not a product of the package, and so the dependency is always on the target. In this case when the plugin gets the tool using `PluginContext.tool` it generally uses the executable target name as the name of the tool, which is logical given that the dependency is on that target. Make the PIF builder take into account that the explicit product of the executable target may not have the same name as the executable target when doing the tool lookup. It should relate the executable target's name to an executable product that builds and runs on the host to make the dependency from the custom task in the PIF, and also calculate the tool's URL when invoking the plugin on a particular target.
Member
Author
|
@swift-ci please test |
Member
Author
|
@swift-ci test Linux |
owenv
approved these changes
May 27, 2026
Member
Author
|
@swift-ci please test |
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Executable targets are automatically promoted as products with the same
name. They can also be named differently using an explicit product that
depends on the executable target.
When declaring a plugin in the same package as an executable used as a
plugin tool the package manifest requires that the dependency be on the
executable target and not a product of the package, and so the
dependency is always on the target.
In this case when the plugin gets the tool using
PluginContext.toolitgenerally uses the executable target name as the name of the tool, which is
logical given that the dependency is on that target.
Make the PIF builder take into account that the explicit product of the
executable target may not have the same name as the executable target
when doing the tool lookup. It should relate the executable target's name
to an executable product that builds and runs on the host to make the
dependency from the custom task in the PIF, and also calculate the tool's
URL when invoking the plugin on a particular target.