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
I'm building image loading into SwiftCrossUI which requires me to support a variety of different image formats. For PNG and JPEG I'm of course using your two awesome pure-swift libraries. However, I've had to fork jpeg and make a few changes in order to add both libraries to my Package.swift. Here's the error that SwiftPM spits out;
error: multiple packages ('jpeg' (from 'https://github.com/tayloraswift/jpeg'), 'swift-png' (from 'https://github.com/tayloraswift/swift-png')) declare products with a conflicting name: 'unit-test’; product names need to be unique across the package graph
The fix that I've done on my fork (which I'm happy to PR if it's the solution that you'd like to go with) was to remove all of the executable products and rename the underlying executable targets to the kebab case names that their corresponding products had originally. This doesn't change the behaviour of swift run (swift run unit-test still works as you'd expect), but it does of course require you to do swift build --target unit-test instead of swift build --product unit-test, which I don't see as much of an issue.
I've confirmed this issue with both Swift 5.9.2 and Swift 6.0.
The text was updated successfully, but these errors were encountered:
stackotter
changed the title
unit-test product name clashes with swift-png's unit-test product (SwiftPM unhappy)unit-test product clashes with swift-png's unit-test product (SwiftPM unhappy)
Sep 1, 2024
It'd make sense to apply your preferred fix to both jpeg and swift-png since it's kinda a symmetrical issue and could other existing projects of yours that follow the same pattern (I haven't checked but I assume that there's probably at least one other package of yours using this pattern)
I'm building image loading into SwiftCrossUI which requires me to support a variety of different image formats. For PNG and JPEG I'm of course using your two awesome pure-swift libraries. However, I've had to fork
jpeg
and make a few changes in order to add both libraries to myPackage.swift
. Here's the error that SwiftPM spits out;The fix that I've done on my fork (which I'm happy to PR if it's the solution that you'd like to go with) was to remove all of the executable products and rename the underlying executable targets to the kebab case names that their corresponding products had originally. This doesn't change the behaviour of
swift run
(swift run unit-test
still works as you'd expect), but it does of course require you to doswift build --target unit-test
instead ofswift build --product unit-test
, which I don't see as much of an issue.I've confirmed this issue with both Swift 5.9.2 and Swift 6.0.
The text was updated successfully, but these errors were encountered: