question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] fix_apple_shared_install_name: also fix install_name in LC_LOAD_DYLIB of executables in cpp_info.bindirs

See original GitHub issue

For all dylib located in cpp_info.libdirs, conan.tools.apple.fix_apple_shared_install_name changes install_name to @rpath in their LC_ID_DYLIB section and also install_name of their dependencies in LC_LOAD_DYLIB.

But executables located in cpp_info.bindirs are not fixed, so they may not be relocatable if they have been linked to dylib of the same recipe fixed afterwards by conan.tools.apple.fix_apple_shared_install_name (because these executables have been created before the call of this method, so they also need this fix).

For example I’m migrating capnproto recipe to conan v2, here is the result of otool -L on one of its executables after package(), even with fix_apple_shared_install_name(self):

/Users/spaceim/.conan/data/capnproto/0.10.1/_/_/package/86b3b8f1d2506eef508c4383f35d09efc02ebc0b/bin/capnp:
	/lib/libcapnpc-0.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	/lib/libcapnp-json-0.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	/lib/libcapnp-0.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	/lib/libkj-0.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)

(libcapnpc, libcapnp-json, libcapnp & libkj are libraries created & packaged in the same recipe, and properly fixed by fix_apple_shared_install_name())

I would have expected:

/Users/spaceim/.conan/data/capnproto/0.10.1/_/_/package/86b3b8f1d2506eef508c4383f35d09efc02ebc0b/bin/capnp:
	@rpath/libcapnpc-0.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libcapnp-json-0.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libcapnp-0.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libkj-0.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
	@rpath/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
SpaceImcommented, Sep 15, 2022

I forgot to mention that you should set -o capnproto:with_openssl=False (because openssl recipe is not conan v2 ready, so it propagates frameworkdirs in AutotoolsDeps, leading to an error in this PR of capnproto).

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found