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

libGrid3D.so is installed with RUNPATH set to the build location #627

Open
wentasah opened this issue Jul 15, 2024 · 1 comment
Open

libGrid3D.so is installed with RUNPATH set to the build location #627

wentasah opened this issue Jul 15, 2024 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@wentasah
Copy link

Environment

  • OS Version: NixOS (not relevant)
  • Source or binary build? Both (branch gz=gui8)

Description

  • Expected behavior: libGrid3D.so is not installed with RUNPATH set.
  • Actual behavior: libGrid3D.so is has RUNPATH set.

Steps to reproduce

Run the following and observe the output:

$ objdump -x /usr/lib/x86_64-linux-gnu/gz-gui-8/plugins/libGrid3D.so|grep PATH
RUNPATH              /home/jenkins/workspace/gz-gui8-debbuilder/build/gz-gui-8.3.0/obj-x86_64-linux-gnu/lib:
$ objdump -x /usr/lib/x86_64-linux-gnu/gz-gui-8/plugins/libGridConfig.so|grep PATH
# no output

libGrid3D.so has RUNPATH set, while other plugins don't.

Discussion

I came across this problem when building Gazebo with the Nix package manager in this project. Nix builds are automatically checked for inappropriate RUNPATH and fail if one is detected.

The reason why RUNPATH is set for libGrid3D.so is that it just a copy of libGridConfig.so, but installed differently (see here). Due to the fact that it is installed as a file rather than a library, CMake doesn't remove RUNPATH setting during installation.

I tried to figure out, how to convince CMake to install a library under a different name and remove RUNPATH settings, however I didn't find anything straightforward (except building the library twice). RENAME keyword is ignored when installing library targets and I don't see a way to do post-installation changes.

We can work around this in the downstream project, but fixing it here might benefit other users too.

@wentasah wentasah added the bug Something isn't working label Jul 15, 2024
@azeey azeey added the help wanted Extra attention is needed label Jul 22, 2024
@azeey
Copy link
Contributor

azeey commented Jul 22, 2024

Thanks for flagging this. We likely won't be getting around to this anytime soon, but I've added the help wanted tag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Status: To do
Development

No branches or pull requests

2 participants