ros2 build_error ai_generated true

colcon build --symlink-install: Changes not reflected after rebuild

ID: ros2/colcon-symlink-stale

Also available as: JSON · Markdown
88%Fix Rate
90%Confidence
3Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

After colcon build --symlink-install, Python or launch file changes are not picked up. Stale install directory.

generic

Workarounds

  1. 92% success Re-source install/setup.bash after rebuilding
    colcon build --symlink-install && source install/setup.bash
  2. 85% success For Python packages, ensure entry_points are in setup.cfg, not just setup.py
  3. 88% success Delete install/<pkg> and rebuild just that package for fresh symlinks
    rm -rf install/my_pkg && colcon build --symlink-install --packages-select my_pkg

Dead Ends

Common approaches that don't work:

  1. Delete install/ and rebuild every time 75% fail

    Loses the speed benefit of symlink install; wastes minutes on full rebuilds

  2. Copy files manually into install/ 85% fail

    Manual copies get overwritten on next build and mask the real symlink issue