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

Redefinition of module 'minizip' #70

Closed
mostafaberg opened this issue Jan 25, 2017 · 5 comments
Closed

Redefinition of module 'minizip' #70

mostafaberg opened this issue Jan 25, 2017 · 5 comments

Comments

@mostafaberg
Copy link
Collaborator

So this is a new interesting issue in a library that I'm trying to get fixed, It's a combination of the Zip framework and how Carthage works I'd say, but thought of seeing what's your opinion, here's how the issue reproduces:

  • Create a new libray project, let's call it acme/greatLib
  • Create a Cartfile with marmelroy/Zip as the dependency
  • run carthage update --platform iOS, things looks great and the library works as it should.
  • Create a new project that will use acme/greatLib, the contents of cartfile will be acme/greatLib
  • run carthage update --platform iOS on that new project
  • Carthage will checkout both dependencies in to greatLib and Zip inside Carthage/Checkouts
  • Carthage will then build Zip first from checkout dir
  • Carthage then proceeds to build greatLib from it's checkout dir
  • greatLib now has it's own Carthage/Checkout directory with Zip checked out in there again (this is how most libraries work with carthage, expected behaviour)
  • All preparations are now done, time to setup the project.

Copying Zip.framework and greatLib.framework into the new project works ok, but the project will fail due to 'minizip.modulemap' has been defined twice, one time in the Zip/ checkout, and another time in greatLib/Carthage/Checkouts/Zip/

I'm kind of baffled on how to fix this, do you have any ideas ?
If nothing is resolvable here I might post the question to Carthage's issues to see if there's any feedback

for reference, here is the actual error code:

/Users/acme/Projects/testProject/Carthage/Checkouts/Zip/Zip/minizip/module.modulemap:1:8: error: redefinition of module 'minizip'
module minizip [system][extern_c] {
       ^
/Users/acme/Projects/testProject/Carthage/Checkouts/greatLib/Carthage/Checkouts/Zip/Zip/minizip/module.modulemap:1:8: note: previously defined here
module minizip [system][extern_c] {

Any tips would be appreciated :)

@SentoCrespo
Copy link

Happening here as well. Exactly the same issue, using Zip inside a library, fails because minzip is either missing or duplicated.

So +1

@SentoCrespo
Copy link

I solved it in an extremely ugly way which I discourage everybody, in your case @mostafaberg

carthage update greatLib --platform iOS

And going to the modulemap where minzip is, and removing it.

Looking for a good solution on this as well as this is a horrible patch.

Is minzip being added to some header search path or similar build settings? I can't think of anything reasonable.

@mostafaberg
Copy link
Collaborator Author

@vCrespoP Actually this is the only way to do it right now, you can automate it by creating a run script build step.

I might get sometime to fix this, but this is surely breaking for anyone using Zip as a dependency in their library, hopefully there will be a fix at some point by me or anyone else who has the time

@idris
Copy link

idris commented Sep 6, 2017

Does anyone know why XCode is looking in the Carthage/Checkouts directory at all? Is there a way to have XCode ignore that directory?

@mostafaberg
Copy link
Collaborator Author

Closing my issue to avoid unnecessary noise, my solution at that time was to simply not track CocoaPods and things will work out of the box.

@idris This is a question to ask on the Carthage page :)

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

No branches or pull requests

3 participants