ros-arch / ros-build-tools

ros-build-tools AUR package
0 stars 0 forks source link

Possible contamination of cmake environment if ROS1 and ROS2 are present #2

Open lprobsth opened 1 year ago

lprobsth commented 1 year ago

I just ran into an error where the setup file of noetic was contaminated with paths from the ROS2 (in this case galactic) installation.

Somehow the CMAKE_PREFIX_PATH in /opt/ros/noetic/_setup_util.py did contain both the paths for noetic and galactic: CMAKE_PREFIX_PATH = r'/opt/ros/noetic;/opt/ros2/galactic'.split(';')

I regularly recompile all packages in the dependency tree if system dependencies (boost, ...) were updated. I think at one point ros-noetic-catkin was updated while ros2 was sourced in the terminal session. Normally the "clear-ros-env.sh" script should handle those situations. Most likely the problem is that "CMAKE_PREFIX_PATH" is not unset by the script.

acxz commented 9 months ago

Thanks for the report @lprobsth ! This is definitely an issue. I don't think that unsetting something so widely used like CMAKE_PREFIX_PATH is a good idea, the best thing would be for this script to parse CMAKE_PREFIX_PATH and remote the conflicting ros path from it. I currently don't have the bandwidth to tackle this issue, but I'll accept PRs for the solution to this.