ros / dynamic_reconfigure

BSD 3-Clause "New" or "Revised" License
47 stars 112 forks source link

Use PYTHON_EXECUTABLE to generate config headers. #146

Closed mikepurvis closed 4 years ago

mikepurvis commented 4 years ago

All current .cfg files in the wild are executable and have shebang lines. Unfortunately, because they are invoked at build time, this is another instance where the specific python that usr/bin/env python leads to becomes important, especially in an environment like Ubuntu Focal, where python is Python 2 (and may not even exist at all).

In this case, it's easy to address— call the correct interpreter directly in the wrapper generated by configure_file. The Windows version already does something similar, so I've updated it to also use the PYTHON_EXECUTABLE cmake var rather than just python.

See related discussions in https://github.com/ros/catkin/pull/1044, https://github.com/ros/ros_comm/issues/1830, https://github.com/ros/roslisp/pull/43

FYI @dirk-thomas