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

Rebuilding Required on Python Script Changes with colcon build --symlink-install #15

Open
AdyanshS opened this issue Nov 15, 2024 · 1 comment

Comments

@AdyanshS
Copy link

Description
When creating a package with both Python and C++ executables using Turtle Nest, the package's CMakeLists.txt file includes an automated rename argument for Python executables. This argument omits the .py suffix from the Python script names.

While this setup works for building the package, I encountered an issue when using colcon build --symlink-install. Typically, with --symlink-install, any changes made to Python scripts should not require rebuilding the entire package. However, due to the automated renaming in CMakeLists.txt, I’m finding that I have to rebuild the package every time I make any modifications to the Python scripts.

Steps to Reproduce

  1. Create a package using Turtle Nest with both Python and C++ executables.
  2. Observe the automated renaming of Python executables without the .py suffix in CMakeLists.txt.
  3. Build the package with colcon build --symlink-install.
  4. Make a change to any Python script in the package.
  5. Attempt to run the modified Python script without rebuilding.

Expected Behavior
With --symlink-install, changes to Python scripts should take effect immediately without requiring a full rebuild.

Actual Behavior
A full rebuild is required after every change to a Python script, counteracting the benefits of --symlink-install.

Environment
ROS distribution: ROS2 Humble

@Jannkar
Copy link
Owner

Jannkar commented Nov 20, 2024

Thank you for reporting this! I can reproduce this and it is indeed an issue.

The original reason for the node renaming was just to unify the node names to avoid any confusion of having the extra .py extension in combined Cpp + Python packages, compared to not having it in pure Python packages.

I think the fact that the node is not correctly symlinked is a problem in the ament_cmake_python package. I'll report this there and link this issue to it.

Since symlink is such a huge feature, I think it is now safer on Turtle Nest side to just remove that renaming of the node to make symlinking work correctly.

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