Skip to content
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

[SR-15929] Package plugin dependency on executable product from different package doesn't find the tool #4346

Closed
abertelrud opened this issue Mar 2, 2022 · 2 comments
Assignees
Labels

Comments

@abertelrud
Copy link
Contributor

Previous ID SR-15929
Radar rdar://problem/89693333
Original Reporter @abertelrud
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 1
Component/s Package Manager
Labels Bug
Assignee @abertelrud
Priority Medium

md5: c86cf68fb054814052ba0d1aa1c1874c

Issue Description:

Package plugin targets can depend on executables, which are then made available to the plugin so it can be looked up with `PluginContext.tool(named🙂`. This doesn't work correctly when the plugin is in one package and the executable is in another, as illustrated by `https://github.com/tonyarnold/swiftpm-buildtool-plugin-examples/tree/swiftlint-example/Example%205%20-%20SwiftLint\` (which I've also replicated in a corresponding `swiftlint-example` at https://github.com/abertelrud/swiftpm-buildtool-plugin-examples).

Possible workarounds include:

  1. put the plugin in the same package as the executable (such as in a fork of the swiftlint repo, similarly to the https://github.com/abertelrud/swift-protobuf.git example), or
  2. have a dependency on a precompiled binary of swiftlint (using a .binaryTarget), or
  3. preinstall swiftlint somewhere where the plugin can find it (e.g. /usr/local/bin)

This should be relatively straightforward to fix in mainline SwiftPM.

@abertelrud
Copy link
Contributor Author

@swift-cicreate

@abertelrud
Copy link
Contributor Author

0384173

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant