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

ament_cmake_symlink_install.cmake breaks CPack #566

Closed
stewpend0us opened this issue Dec 16, 2024 · 4 comments
Closed

ament_cmake_symlink_install.cmake breaks CPack #566

stewpend0us opened this issue Dec 16, 2024 · 4 comments

Comments

@stewpend0us
Copy link

stewpend0us commented Dec 16, 2024

When I do a symlink install and then try to cpack: ament_cmake_symlink_install.cmake fails.

When cpack runs CMAKE_CURRENT_BINARY_DIR is not set. This casuses ament to try to create symlink_install_manifest.txt in the root directory which causes it (and cpack) to fail.

Error message:

CMake Error at /.../.../ament_cmake_symlink_install/ament_cmake_symlink_install.cmake:5 (file):
  file failed to open for writing (Permission denied):

    /symlink_install_manifest.txt

Work around:

manually create /symlink_install_manifest.txt that way ament will find the file and write to it and cpack will not fail.

better yet: ln -s /dev/null /symlink_install_manifest.txt

@stewpend0us
Copy link
Author

Welp. Turns out while this does get me an install file the install file doesn't have any content. I gues CMake/CPack aren't capable of following symlinks...

@christophebedard
Copy link
Member

Unfortunately, we don't really expect CPack to work with symlink installs.

@stewpend0us
Copy link
Author

stewpend0us commented Jan 9, 2025

I was able to get this working. The key was not using colcon --symlink-install and instead setting export CMAKE_INSTALL_MODE=SYMLINK before calling colcon. Then unset CMAKE_INSTALL_MODE after.

This got me both symlinks in my install directory AND working CPack

The only difference I noticed was that the symlinks are relative (CMAKE_INSTALL_MODE) instead of absolute (--symlink-install) but I think there's more going on internal to CMake/CPack with CMAKE_INSTALL_MODE

@christophebedard
Copy link
Member

Thanks for the follow-up. I will close this for now, feel free to re-open if there's anything.

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

No branches or pull requests

2 participants