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-14343] SPM fails to invoke plugins when building local dependencies #4445

Closed
tayloraswift opened this issue Mar 12, 2021 · 4 comments
Closed
Assignees
Labels

Comments

@tayloraswift
Copy link

Previous ID SR-14343
Radar rdar://problem/75370184
Original Reporter @Kelvin13
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

DEVELOPMENT-SNAPSHOT-2021-03-07-a

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug
Assignee @abertelrud
Priority Medium

md5: f8fd742a47ef0b2b9469382eb0e2c191

Issue Description:

If a local dependency uses a package manager plugin, packages that depend on it fail to invoke the plugins when building. I have attached a minimal pair of example projects as a test case. If you navigate to the client-package directory, and run

SWIFTPM_ENABLE_PLUGINS=1 swift build

it fails with

Open File failed on file: plugin-local-dependency/client-package/.build/x86_64-unknown-linux-gnu/debug/ModuleCache/modules.timestamp
Error: No such file or directory
Attempted again: 10 times
plugin-local-dependency/example-package/Sources/Example/example.swift:3:11: error: cannot find type 'X' in scope
    let x:X
          ^

However, if you build example-package directly, the plugin runs as expected, and it builds successfully.

@typesanitizer
Copy link

@swift-ci create

@fourplusone
Copy link
Contributor

Here's an updated version of the source code which matches the new API. plugin-local-dependency-1.zip

@abertelrud
Copy link
Contributor

d5d3b92

@abertelrud
Copy link
Contributor

Thank you for the fix @fourplusone!

@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

4 participants