Skip to content

16.5.4

Choose a tag to compare

@github-actions github-actions released this 06 Jun 09:09

Abstract

Note

This pull-request is a continuation of #1614, created by @f0reachARR.
And fixed by @Zhenfeng-Sun.
The description is written by @f0reachARR.

This PR will fix these errors which were happened when --symlink-install is not used

  • executable 'scenario_test_runner.py' not found on the libexec directory
  • [openscenario_preprocessor_node-XX] No executable found
    • Direct cause: ros2 run openscenario_utility validation.py in openscenario_preprocessor_node

Background

install in CMake does not respect original file permission, and use default "file" permission which is read and write.

If no permissions are specified files will be given the default permissions specified in the FILES form of the command, and the directories will be given the default permissions specified in the PROGRAMS form of the command.

When --symlink-install is used, install is replaced by ament and this behavior does not happen, then everything works.
However, without --symlink-install, some Python based packages will lose these executable permission and then they stopped working.

Details

To address this error, I have two options: USE_SOURCE_PERMISSIONS or PROGRAMS

  • USE_SOURCE_PERMISSIONS is a option of install, which will respect original file permission. However, adding this will prevent symlink behavior and force copy based install.
  • PROGRAMS is special form of FILES in install, which will set permission executable. However, I need to replace DIRECTORY with PROGRAMS for each executable files.

In my research, ament_cmake_python uses USE_SOURCE_PERMISSIONS for non --symlink-install case. But it is complex to check if we use --symlink-install and change install options, I use PROGRAMS.

After this pull request, we need to specify all executable in CMakeLists.txt in addition to add Python script to package.

Related Issues