Skip to content

Set DYLIB_COMPATIBILITY_VERSION and DYLIB_CURRENT_VERSION.#91

Merged
weichsel merged 1 commit into
weichsel:developmentfrom
DevAndArtist:dylib-compatibility-issue
Mar 5, 2019
Merged

Set DYLIB_COMPATIBILITY_VERSION and DYLIB_CURRENT_VERSION.#91
weichsel merged 1 commit into
weichsel:developmentfrom
DevAndArtist:dylib-compatibility-issue

Conversation

@DevAndArtist

@DevAndArtist DevAndArtist commented Mar 1, 2019

Copy link
Copy Markdown
Contributor

IOS-Pods-DFU-Library recently updated its dependency to use ZIPFoundation. In our project we're using Carthage to include that framework, so I also included ZIPFouncation using Carthage. However this results into an error when running the application.

dyld: Library not loaded: @rpath/ZIPFoundation.framework/ZIPFoundation
  Referenced from: /private/var/containers/Bundle/Application/6768A1C7-5C6E-471B-9969-F84AEFE42EA3/App.app/Frameworks/iOSDFULibrary.framework/iOSDFULibrary
  Reason: Incompatible library version: iOSDFULibrary requires version 1.0.0 or later, but ZIPFoundation provides version 0.0.0

After doing some search I found a similar issue in a different project which was solved by setting DYLIB_COMPATIBILITY_VERSION and DYLIB_CURRENT_VERSION.

Changes proposed in this PR

  • This PR sets the mentioned project settings to 1 to resolve the mentioned incompatibility when building the project using Carthage.

Tests performed

  • I don't know what I can or should test, please advise. Our project compiles with this change or fails with the mentioned error without it.

Further info for the reviewer

@weichsel

weichsel commented Mar 3, 2019

Copy link
Copy Markdown
Owner

Hi,
Thank you for making me aware of this issue and for the pull request.

Can you provide some details about your build/project setup.
ZIPFoundation currently only supports integration via Carthage by using the --no-build flag.
As we only maintain a single (cross-platform) target, the ZIPFoundation.xcodeproj in ./Carthage/Checkouts/ZIPFoundation must be dragged into your Xcode workspace. This should automatically build a compatible .framework when you import ZIPFoundation in your project.

@DevAndArtist

DevAndArtist commented Mar 3, 2019

Copy link
Copy Markdown
Contributor Author

@weichsel well in our case we don't really use ZIPFoundation as it's only a dependency of IOS-Pods-DFU-Library and is only used when you provide firmware files in zip format. In our case the files are hardcoded as base64 strings which makes zipping unnecessary.

In short I only have IOS-Pods-DFU-Library as Carthage dependency which fetches ZIPFoundation. Without the above patch I cannot run our app as it results in the above crash at launch. The patch fixes it and Carthage is able to build a compatible .framework automatically (I run carthage update --platform iOS in our project only). I don't see the need to include ZIPFoundation.xcodeproj when carthage is used as it defeats the purpose of the package manger and basically fakes submodules. IIRC Cocoapods change these DYLB values automatically, but I don't know for sure.

@weichsel

weichsel commented Mar 4, 2019

Copy link
Copy Markdown
Owner

@DevAndArtist Thanks for the explanation.

The changes look good - Setting those variables to 1 shouldn't introduce any problems.
I will perform some manual tests tomorrow and if everything works well on all supported platforms, I will merge your changes.

@weichsel weichsel merged commit a0a14a1 into weichsel:development Mar 5, 2019
@DevAndArtist

DevAndArtist commented Mar 6, 2019

Copy link
Copy Markdown
Contributor Author

@weichsel could you make a new release with this change please (0.9.9 preferably)?

@DevAndArtist DevAndArtist deleted the dylib-compatibility-issue branch March 6, 2019 09:28
@DevAndArtist DevAndArtist restored the dylib-compatibility-issue branch March 6, 2019 09:28
@weichsel

weichsel commented Mar 6, 2019

Copy link
Copy Markdown
Owner

I am waiting for 2 additional fixes before merging into master. (No ETA, so far).
Please point the ZIPFoundation dependency in your Cartfile to development in the meantime.

@DevAndArtist

Copy link
Copy Markdown
Contributor Author

@weichsel any updates on this?

@a1drich

a1drich commented Apr 1, 2019

Copy link
Copy Markdown

@weichsel any updates? been waiting for this for a while now on master branch

@OwenJie

OwenJie commented Apr 2, 2019

Copy link
Copy Markdown

any updates? been waiting for this for a while now on master branch

@TictoDev

TictoDev commented Apr 3, 2019

Copy link
Copy Markdown

Need this too!

@weichsel

Copy link
Copy Markdown
Owner

The changes of this PR are now available in ZIP Foundation 0.9.9

Sorry that it took so long, but the release was blocked by a regression that lead to an endless loop when processing very small data blocks with libcompression.

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

Successfully merging this pull request may close these issues.

5 participants