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

CMake package registry breaks workspace isolation #1119

Open
Levi-Armstrong opened this issue Aug 22, 2020 · 3 comments
Open

CMake package registry breaks workspace isolation #1119

Levi-Armstrong opened this issue Aug 22, 2020 · 3 comments

Comments

@Levi-Armstrong
Copy link
Contributor

We recently ran into issues with packages that leverage the CMake package registry feature. This feature does not seem to be compatible with build tools like catkin, colcon, etc.. Should catkin automatically be passing the CMake disable flags?

  -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON
  -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON
@gavanderhoorn
Copy link
Contributor

This feature does not seem to be compatible with build tools like catkin, colcon

What it seems to 'break' is workspace isolation.

Whether it's completely incompatible with Catkin and Colcon I'm not sure.

@dirk-thomas
Copy link
Member

I don't know enough about the CMake package registry to make a suggestion here. It sounds reasonable to me though.

Even with these flags embedded by default the user should be able to pass different values if desired.

Would you like to create a pull request for the proposed change? Probably not only to catkin but also catkin_tools.

Just for reference the parallel ticket on colcon: colcon/colcon-cmake#91

@KazNX
Copy link

KazNX commented Oct 10, 2021

This is a really subtle, but problematic issue with CMake, especially on Windows. I've experienced unexpected and highly undesirable behaviour from CMake's "magic" use of it's package registry where it's basically used a recently built version of a library in an unrelated workspace.

The way I see it, colcon's philosophy is to create a self-contained workspace which is at odds with the CMake package registry. It would be reasonable to disable the package regsitry by default an option to turn restore the default "magic" behaviour.

To avoid the issue though, you can use --cmake-args, --catkin-cmake-args and --ament-cmake-args to pass through the options you list above. Probably best to use either default.yaml or a mixin.

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

4 participants