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.
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 specificpython
thatusr/bin/env python
leads to becomes important, especially in an environment like Ubuntu Focal, wherepython
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 thePYTHON_EXECUTABLE
cmake var rather than justpython
.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