You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding local target dependencies or external dependencies to my plugin doesn't result in an error when declared in the package manifest. However, importing these dependencies in the plugin code makes SwiftPM complain that it can't find these modules.
Expected behavior
I'd expect to declare dependencies and be able to actually import them.
Actual behavior
An error is emitted when importing a module that was declared as a dependency in the plugin code. This is the case for both build tools and command tools.
Steps to reproduce
Create a TestPackage directory, cd into it, and run swift package init.
Swift & OS version (output of swift --version && uname -a)
swift-driver version: 1.55.1 Apple Swift version 5.7 (swiftlang-5.7.0.113.202 clang-1400.0.16.2)
Target: arm64-apple-macosx13.0
Darwin Filip-MacBook-Air.local 22.0.0 Darwin Kernel Version 22.0.0: Tue May 24 20:30:32 PDT 2022; root:xnu-8792.0.50.111.3~5/RELEASE_ARM64_T8103 arm64
The text was updated successfully, but these errors were encountered:
Yes, I think so. This isn't currently supported and thus there should be up-front validation. In the long run we should make it work, but that will require some build system changes (we either have to be able to do parts of the build before plugins run, or interleave running plugins are part of the build).
Description
Adding local target dependencies or external dependencies to my plugin doesn't result in an error when declared in the package manifest. However, importing these dependencies in the plugin code makes SwiftPM complain that it can't find these modules.
Expected behavior
I'd expect to declare dependencies and be able to actually import them.
Actual behavior
An error is emitted when importing a module that was declared as a dependency in the plugin code. This is the case for both build tools and command tools.
Steps to reproduce
TestPackage
directory, cd into it, and runswift package init
.Plugins/MyPlugin/Plugin.swift
containing:Swift Package Manager version/commit hash
Swift Package Manager - Swift 5.7.0
Swift & OS version (output of
swift --version && uname -a
)swift-driver version: 1.55.1 Apple Swift version 5.7 (swiftlang-5.7.0.113.202 clang-1400.0.16.2)
Target: arm64-apple-macosx13.0
Darwin Filip-MacBook-Air.local 22.0.0 Darwin Kernel Version 22.0.0: Tue May 24 20:30:32 PDT 2022; root:xnu-8792.0.50.111.3~5/RELEASE_ARM64_T8103 arm64
The text was updated successfully, but these errors were encountered: