SPM Plugin with binary target high CPU Usage

Hey there,

I was just about to add a SPM build tool plugin to my project.
After adding the dependency of the plugin to my Package.swift file, Xcode started getting really slow. A quick look in the Activity monitor showed that Xcode has a massive cpu usage (100% or higher).
I've also noticed that the swift package seems to resolve the plugin dependency again and again (especially the binary target the dependency contained). Removing the dependency from the Package file brings the cpu back to a normal load.
Is this a known bug or is there something I can do against it?

Adding a plugin without a binary target works just fine. And as a side note, I've tried this with Xcode 13.4.1 (tools version 5.6) and 14.0 beta 3 (tools version 5.7). It seems its only an issue with the checkout, since adding a local plugin to my package with a binary target also works without problems.

3 Likes

I have the same issue with an executableTarget and GitHub - lukepistrol/SwiftLintPlugin: A Swift Package Plugin for SwiftLint and or GitHub - MarcoEidinger/SwiftFormatPlugin: Swift Package (Command) Plugin to format source code with nicklockwood/SwiftFormat. I disabled the plugins for now as text editing in Xcode becomes too slow.