-
Notifications
You must be signed in to change notification settings - Fork 113
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
Name collision caused by GCDWebServer dependency #402
Comments
I thought it would be possible to simply rename the library product from the GCDWebServer package but I forgot that GCDWebServer is implemented in Objective-C and Objective-C has no namespacing. So it doesn't matter if the library is called in a different name, once the loader loads the classes they will collide. Changing the name of the repo, package or target makes no difference either. I also looked into Then with this in mind I thought that every single symbol defined in readium/GCDWebServer would need to be renamed, but I am actually only seeing a warning for the following symbols when I run my app: GCDWebServerHandler so for instance Do you have any preference for the prefix to be used? Using
Given that we have a |
I have a preference for the |
we should probably also rename the repo to |
As it's hosted on https://github.com/readium/gcdwebserver, I think it's fine. Our convention so far is to use the organisation name as part of the name.
|
I ended up modifying ALL the symbols. It just looked too weird to have some symbols prefixed with |
This depends on the following PR: readium/GCDWebServer#12 Together these solve issue readium#402
This depends on the following PR: readium/GCDWebServer#12 Together these solve issue readium#402
Describe the bug
Our app depends on the official GCDWebServer package for reasons unrelated to Readium. The Readium swift-toolkit also depends on a fork of GCDWebServer. When we build and run our app that depends on both we encounter a runtime error detailing that classes in the GCDWebServer module are implemented in 2 separate libraries, and one of the two will be used (likely randomly). Since there are no guarantees that the Readium fork will remain upstream compatible, an app that integrates the Readium toolkit must be able to reliably use both versions of GCDWebServer.
How to reproduce?
Readium version
2.6.1
OS version
iOS 17
Testing device
IPhone 11 and simulators
Environment
Additional context
This was discussed during the monthly call on 6 March 2024. We agreed that the version shipped with Readium should be renamed. I volunteered to do this change.
The text was updated successfully, but these errors were encountered: