-
Notifications
You must be signed in to change notification settings - Fork 194
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
Add CMake option to force installation of path.d-related files in yarp_configure_external_installation #2444
Comments
I don't agree with this need, mostly because setting a different Proper packaging systems, when building a CMake package, set the right The path.d mechanism is already abused, I don't think we should extend that. |
In which sense it is not "right"? Making fully relocatable packages is explicitly recommended in the CMake documentation (https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#creating-relocatable-packages), and as far as I know all the our packages that use
Interesting, I think this would fix the specific problem raised in https://github.com/robotology/icub-packaging/blob/5768d6c1768a26c583ecb6866b67494fe37841c5/linux/build-iCub-packages.sh#L387, but unfortunately other packaging system (like vcpkg) also install packages in a temporary directory and then move the installation files to a different directory without using
In which sense it is abused? In my experience most users just use |
The use of
For reference, the problem you describe is #336. I'm referring mostly to #522 (path.d folder should not be searched using ResourceFinder) which is partially related, since ResourceFinder if I remember correctly, uses Basically the But it was decided to extend this in order to simplify the installation for the user, and to allow the developer to decide in which subfolder they wanted to put their files. This complicates the things, since the path.d files are supposed to contain the absolute path, which makes them necessarily not-relocatable, and that, as you pointed out, is not recommended. The same reasoning applies with some changes to the ".ini" files that contains the plugin paths. Also, due to the fact that it was decided that the path.d folder should is searched using ResourceFinder, it was decided, in order to limit the damage and confusion that this was creating, that the the path.d file would have been installed only if the package was installed in the same prefix as YARP, otherwise there would have been folders named For example, iCub would install
If you have to extend Now, if we add a I'm not sure if I managed to explain what I really mean by abused here... It's actually not |
I see what you mean, then yes I totally agree that the existing system is quite complicated, what we are doing about this is effectively ignoring the
I am afraid what you link are just some extremely package-specific scripts , and do not reflect what is happening for most packages. For example, for what regards vcpkg, the On the other hand, conda is less afraid of having absolute hardcoded installation path because those are automatically handled by conda itself, see https://docs.conda.io/projects/conda-build/en/latest/resources/make-relocatable.html . However, fortunately in conda when building packages the
As far as I know, |
It is used by CPack, since when you run CPack (for any generator) it creates an installation inside your build directory (using
My personal advice for the superbuild is to use |
Ah, I got what you mean now, sorry. To recap if I understood correctly,
We tried to use |
However, if you think what is proposed in the issue increase the complexity too much, we can close the issue and manually |
It would be pretty easy to write the files manually anyway... |
Revisiting this, the actual problem is not to either generate automatically the file or to write it manually (like in https://github.com/robotology-legacy/icub-packaging/blob/5768d6c1768a26c583ecb6866b67494fe37841c5/linux/build-iCub-packages.sh#L387), but the fact that the file installed in the |
Is your feature request related to a problem? Please describe.
When packaging packages that depend on YARP and use
yarp_configure_external_installation
, it useful to be able to force the generation of thepath.d
files, as the packager may know that YARP and the downstream package (for example iCub) will be installed in the same prefix, even if the CMAKE_INSTALL_PREFIX used is not the same one of YARP during packaging.Describe the solution you'd like
A CMake option for the downstream projects (something like
YARP_FORCE_PATH_D_INSTALLATION
) that permits to force the execution of the logic in https://github.com/robotology/yarp/blob/master/cmake/YarpInstallationHelpers.cmake#L230 . This can be done similarly to other options that are already defined byyarp_configure_external_installation
, i.e.YARP_FORCE_DYNAMIC_PLUGINS
.Describe alternatives you've considered
An alternative that is in place in https://github.com/robotology/icub-packaging/blob/5768d6c1768a26c583ecb6866b67494fe37841c5/linux/build-iCub-packages.sh#L387 is to manually generate the
iCub.ini
file in the correct location, but this is a bit brittle as it requires some custom logic for each packaging system, and effectively duplicate the CMake logic already contained in the CMake macro.The text was updated successfully, but these errors were encountered: