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

unit-test product clashes with swift-png's unit-test product (SwiftPM unhappy) #21

Closed
stackotter opened this issue Sep 1, 2024 · 3 comments

Comments

@stackotter
Copy link

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.

@stackotter 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
@stackotter
Copy link
Author

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)

@tayloraswift
Copy link
Owner

sounds good to me!

@tayloraswift
Copy link
Owner

these products were internalized in 2.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants