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
{{ message }}
Repository navigation
Xcode 16.3: error when adding SwiftLint plugin to Package.swift target #6042
Including SwiftLint as a plugin in a Swift Package target causes the following error message on Xcode 16.3:
error: a prebuild command cannot use executables built from source, including executable target 'swiftlint'
error: build planning stopped due to build-tool plugin failures
Example Package.swift:
// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.
importPackageDescriptionletpackage=Package(name:"example-executable",platforms:[.macOS(.v14)],dependencies:[.package(url:"https://github.com/SimplyDanny/SwiftLintPlugins",exact:"0.58.2")],targets:[.executableTarget(name:"example-executable",plugins:[.plugin(name:"SwiftLintBuildToolPlugin",package:"SwiftLintPlugins")])])
The issue wasn't present on Xcode <= 16.2 and disappears when downgrading to Xcode 16.2.
And there you go. Seems to be an issue in the just released version of the Swift 6.1 toolchain. Nothing that SwiftLint can do about it, other than switching to the command plugin for the time being.
I can reproduce it with swift build, but not when building with Xcode. So maybe it still works for most users.
Nevertheless, I'll pin this issue to let others know. Thanks for reporting, @florianschulz!
Activity
SimplyDanny commentedon Apr 3, 2025
I don't see this in a simple Swift package. Can you share a reproducer?
florianschulz commentedon Apr 3, 2025
Sure, here you go:
example-executable.zip
SimplyDanny commentedon Apr 3, 2025
And there you go. Seems to be an issue in the just released version of the Swift 6.1 toolchain. Nothing that SwiftLint can do about it, other than switching to the command plugin for the time being.
I can reproduce it with
swift build, but not when building with Xcode. So maybe it still works for most users.Nevertheless, I'll pin this issue to let others know. Thanks for reporting, @florianschulz!
Noobish1 commentedon Apr 4, 2025
What you can do as a workaround is install SwiftLint via Mint and wrap it in your own BuildTool plugin.
Pin CI to Xcode 16.2 to work around SwiftLintPlugins regression
Pin CI to Xcode 16.2 to work around SwiftLintPlugins regression (#1)
fix: detach SwiftStyleKit 自身 dogfooding 繞開 Swift 6.1.2 SwiftPM bug
ci: 修正 Xcode pin 版本 16.5 → 26.3
modify: 恢復 SwiftStyleLint dogfooding + strict 環境變數開關
modify: 恢復 SwiftStyleLint dogfooding + strict 環境變數開關