-
Notifications
You must be signed in to change notification settings - Fork 992
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
[feature] Provide macOs packages to build with @rpath in install names #10253
Comments
I am not sure about the request, you mean adding rpaths always? In the new integrations, we are trying to respect as much as possible what the users build scripts are doing. We map only the minimum information from the Conan settings, like defining the architecture, or if the library is shared or static. But things like rpaths seems like something Conan should not change? The current CMake default for example is not good enough? I am not sure that Conan changing the default CMake behavior would be a good approach. |
Ah so your saying, any package in ConanCenter (e.g fmt::fmt) which has naked install paths on macOS is the CMake default behavior, because MACOSX_RPATH is default to off? I think with naked install_names which then the loader does not consider the RPATHS mechanism as described in the post above, seems to be simplifiying to much. With naked install_names the behavior is similar to Windows (which is anyway a nuissance) So, only LD_LIBRARY_PATH mechanism can be used to run the executable, which is a big disadvantage IMO. I dont understand why RPATH mechanics are turned off on macOS, since it does not hinder anything (on precondition that you only have relative paths etc in any RPATH ( Havigh RPATH properly setup enables to have a cmake build & install where the binaries properly work without having |
I'm currently fixing all CCI recipes regarding shared libs on macOS: https://github.com/conan-io/conan-center-index/pulls?q=is%3Apr+in%3Atitle+relocatable+macos It will take lot of time since they are all polluted by So basically:
Autotools based recipe are also broken without manual fix of configure script (here it's a "bug" in autotools actually). Few recipes have this fix, it must be extended to all autotools based recipe. I've also suggested to implement a hook in conan-center to ensure that shared libs are:
|
Thats sounds very crisp!
Thanks for your effort!
|
This needs a check ("look into") into the new integrations ( |
Hi @gabyx - I can confirm that @SpaceIm 's summary is accurate. The newer CMake integrations in Conan 2.0 will no longer alter CMake's default behaviour with regards to install name handling for macOS shared libraries. In general, it will be down to the recipe (or the upstream libraries themselves) to "do the right thing" when it comes to building relocatable libraries with the For recipes of libraries that are built with CMake, if the minimum declared version causes the Mileage may vary with other build systems, or libraries that override CMake's own default behaviour in this regard. In order of preference, this may require: upstream fixes, patches in the recipe, or patching the files in the From what I can see, packages in Conan Center are already moving towards this convention - I have downloaded a few libraries and they seem correct in this regard. Please feel free to raise new issues in Conan Center's GitHub page if you encounter any recipe that needs fixing. |
@jcar87 Nice to here, that sounds pretty reasonable. |
This tool would execute as the final step in the |
#11365 moves the |
The rather old answer describes the problem quite well: #1238 (comment)
On macOS it would help a lot if all packages in ConanCenter have an option (if not defaulted…) to have install names prepended with @rpath. This is already available for conan builds but probably in a lot of packages not activated etc? This would align it better to Linux and would make debugging much easier. As executables can use the RPATH facility to load the libs from Conan. Lots of packages come with naked install names posing quite some headache and not so good behavior (see answer above).
The text was updated successfully, but these errors were encountered: