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

SPM conflict SwiftProtobuf #2088

Closed
nerzh opened this issue Mar 21, 2022 · 14 comments
Closed

SPM conflict SwiftProtobuf #2088

nerzh opened this issue Mar 21, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@nerzh
Copy link

nerzh commented Mar 21, 2022

Sorry for my english

Describe the bug
Google FireBase has SwiftProtobuf as a dependency:
.package(
name: "SwiftProtobuf",
url: "https://github.com/apple/swift-protobuf.git",
"1.15.0" ..< "2.0.0"
),

but wallet-core has SwiftProtobuf as a dependency too:

.binaryTarget(
name: "SwiftProtobuf",
url: "https://github.com/trustwallet/wallet-core/releases/download/2.6.36/SwiftProtobuf.xcframework.zip",
checksum: "40518a795e841bbd2c7e1f7019357b8e09b321a9c1ea264b0819f85575ac04c2"
)

Because you have a binary target, this causes a name conflict with SwiftProtobuf.

Please, tell me what to do with it, thanks

To Reproduce
Steps to reproduce the behavior:

  1. add Firebase to ios project
  2. add wallet-core to the project

Expected behavior
No conflict with SwiftProtobuf

@nerzh nerzh added the bug Something isn't working label Mar 21, 2022
@hewigovens
Copy link
Contributor

Yes, because wallet core is a binary framework, it needs SwiftProtobuf as a binary framework too. The workaround is: download wallet core xcframework from github release and manually add it to your project.

@oliveratkinson-bc
Copy link

@hewigovens This doesn't really work around the issue since Firebase includes swift-protobuf and statically links the binary to the resulting app bundle, which means the WalletCore.framework isn't able to locate it since it has an explicit rpath to @rpath/SwiftProtobuf.framework/SwiftProtobuf

To solve this, we would likely need to allow compilation of wallet-core via SPM rather than as a binary framework so that it can include the same versioned swift-protobuf dependency

@nerzh
Copy link
Author

nerzh commented Aug 31, 2022

@oliveratkinson-bc it would be great

@hewigovens
Copy link
Contributor

@oliveratkinson-bc I agree with you, but wallet core needs special build steps and SPM seems limited (unlike CocoaPods, easy to add scripts) cc @Milerius

@oliveratkinson-bc
Copy link

It's worth noting that SPM has got some upgrades as of 5.7, one of which is "Package Manager Plugins" that should aid in the ability to script elements of the build pipeline

@nerzh
Copy link
Author

nerzh commented Sep 2, 2022

this article says it's available already in 5.6

https://theswiftdev.com/beginners-guide-to-swift-package-manager-command-plugins

@oliveratkinson-bc
Copy link

@nerzh yes, but it had issues, became usable in 5.7

@EvgenV
Copy link

EvgenV commented Mar 10, 2023

Hi @oliveratkinson-bc !
Have you managed to solve this problem? Could you please share with workaround?

@nerzh
Copy link
Author

nerzh commented Mar 19, 2023

🙄

@MaksymVereshchaka
Copy link

@nerzh @oliveratkinson-bc @EvgenV
I would like to know if there are any results?

@oliveratkinson-bc
Copy link

@MaksymVereshchaka I have not found a workaround for this issue

@nerzh
Copy link
Author

nerzh commented Sep 14, 2023

no, I don’t understand why the package was called that at all. You could also call the wallet not Trustwallet but Googlewallet, why not ? 😀

@tysonwil
Copy link

tysonwil commented Oct 23, 2023

@nerzh @oliveratkinson-bc were you ever able to find a workaround to this?

@dinhnhat0401
Copy link

@tysonwil @nerzh @oliveratkinson-bc take a look at this PR. Please give a thumb up if this fix your issue.
#3599

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants