Alpha8 hard coded paths

As a continuation of
Redirecting to Google Groups and
Redirecting to Google Groups

I noticed a lot of unexpected hard coded paths in the binary releases of alpha 8. Note that I only checked Windows and Linux.

In the Linux installation directions at GitHub - ros2/ros2: The Robot Operating System, is a meta operating system for robots., it mentions putting the release in “~/ros2_install” and yet I see a lot of references to /home/rosbuild/ci_scripts/ws. In the Windows installation instructions at GitHub - ros2/ros2: The Robot Operating System, is a meta operating system for robots., it mentions putting the release in “C:\dev\ros” and yet I see a lot of references to “C:\J\workspace\packaging_windows\ws”.

The biggest issues that I noticed so far is the inability to link to the TF2 library on Windows and the inability to run ament directly on Linux. Can we get the binary releases to match the installation instructions?

Specific details are below:
in ros2-windows\share\ament_index\resource_index\parent_prefix_path
Everything is prepended with C:\J\workspace\packaging_windows\ws\install

py3.5.egg-info
ros2-windows\Lib\site-packages*-0.0.0-py3.5.egg-info\SOURCES.txt
or
ros2-linux\lib\python3.5\site-packages*-0.0.0-py3.5.egg-info\SOURCES.tx

ros2-windows\CMake\console_bridge-config.cmake
Line 6: set(console_bridge_INCLUDE_DIRS “C:/J/workspace/packaging_windows/ws/install/include”)
Line 11: PATHS “C:/J/workspace/packaging_windows/ws/install/lib”

all the scripts in the ros-linux/bin/python and ros-linux/bin/launch have the #!/home/rosbuild/ci_scripts/venv/bin/python shebang

in ros2-linux\lib\console_bridge\cmake\console_bridge-config.cmake
Line 6: set(console_bridge_INCLUDE_DIRS “/home/rosbuild/ci_scripts/ws/install/include”)
Line 11: PATHS “/home/rosbuild/ci_scripts/ws/install/lib”

ros2-linux\local_setup.sh (2 hits)
Line 5: : {AMENT_CURRENT_PREFIX:=/home/rosbuild/ci_scripts/ws/install} Line 11: _ament_python_executable="/home/rosbuild/ci_scripts/venv/bin/python" C:\Users\Geoffrey.Viola\Downloads\ros2-linux\setup.sh (1 hit) Line 5: : {AMENT_CURRENT_PREFIX:=/home/rosbuild/ci_scripts/ws/install}
ros2-linux\share*\local_setup.sh (1 hit)
Line 5: : ${AMENT_CURRENT_PREFIX:=“/home/rosbuild/ci_scripts/ws/install”}
ros2-linux\share\ament_index\resource_index\parent_prefix_path*
/home/rosbuild/ci_scripts/ws/install

I will focus on the Linux release in this post. Can you please clarify what exactly you mean with “a lot of unexpected hard coded paths”. I could guess and will also comment on some classes of cases below but I think it would be helpful if you could state specific examples when referring to issues.

The following groups of cases are the ones I am aware of. If you noticed more cases please add them explicitly:

1 Like

Thanks Dirk. By “a lot of unexpected hard coded paths”, I meant that I wasn’t sure if they needed to be there or how they influence the system. You touched on all the details. They seemed like a red flag, but it sounds like you’re aware of them.

I took the opportunity to also look at the Windows archive and found the following cases:

  • The parent_prefix_path files (same as on Linux).

  • The SOURCES.txt files (same as on Linux).

  • The CMake config file of console_bridge.

So the list seems to be much shorter on Windows since:

  • .bat files can get their own path like .bash files can.

  • The Python scripts are actual executables (when been generated from an entry point).

  • No pkg_config on Windows.

Therefore I would conclude that we need to follow up on two items:

  • Double check on the ament resource index. Maybe there is a way to avoid absolute paths at least if they are referring to something within the same prefix where the resource is being stored in.

  • We really need to resolve the shebang line issue. I would think that even in a non venv the hardcoded path is a problem as it needs to match with the target system. Maybe instead we could postprocess the archive to rewrite the shebang line to something like /usr/bin/env python3. Not sure what others think of that idea?

Based on your post I spend some time on these “annoying details” and was able to resolve three of them:

I have updated the previous posts with the current state. If anyone has an idea how to resolve the remaining ones I would be more then happy to hear them. (Or if you would like to create a pull request for console_bridge please feel free to do so.)

1 Like