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

Reference common files in subpackages #488

Open
jparisu opened this issue Mar 3, 2022 · 0 comments
Open

Reference common files in subpackages #488

jparisu opened this issue Mar 3, 2022 · 0 comments

Comments

@jparisu
Copy link

jparisu commented Mar 3, 2022

Hi there. First of all, congratulations for this tool, it works excellent and it is incredibly useful.

I have found a specific use case in one of my projects, and I do not know how to better handle it using colcon tool.

Case

I have a github repository with folders inside, each of them is a cmake colcon package (with its CMakeLists.txt, its package.xml, etc.) (for example, check this repository of ROS2 https://github.com/ros2/rclcpp).
My problem here is that I have several files that are going to be used in ALL or several of the packages.
i.e. LICENSE file, VERSION file, some .cmake common files, etc.


Question

Can I handle this shared files in a way that I do not have to maintain copied files?


Possible solutions

These are the solutions I have thought about so far, but any of them seems like "completly correct" for me:

  1. Copy the file in every subdirectory needed. This causes a gigantic redundancy, and the modification in each shared file must be copied to the rest of the files.
  2. Use symbolic links. This do not work with windows, as the creation of symlinks needs administrator rights, so the Github repository will be broken.
  3. Use a new colcon package only to hold these shared files. This does not seems right, as it adds a dependency and a new colcon package that is just a hotchpotch package.

Colcon feature

I do not think this is a strange use case (having into account the package distribution in ROS2 repositories), and maybe colcon could add a tool or a way of handling this.

Maybe, a possibility was to create a kind of package that could contain subpackages. This way, subpackages are installed independently and could be found by external packages, but at the same time, some CMake variables could be set from the parent "superproject", avoiding copy of files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant