ament / ament/ament_cmake

Python packaging should not call compileall on the install folder since it is likely installed as root

Open
#609 1 comment 0 reactions 1 assignee Claimed by @cottsay View on GitHub
Dominant language
CMake
Stars
125
Forks
147
PR merge metrics
No merged PRs in 30d

Description

This line here calls `python3 -m compileall ` but this is usually inside a system folder and is installed using root.

This causes permission errors during packaging. The compileall should only happen if the install target is called, because the install command is usually executed like
```
sudo cmake --install
```

because it needs root permissions anyway to do the install. But packaging should be able to happen without needing to write to any root-owned folders, which is what the compileall module is trying to do.

https://github.com/ament/ament_cmake/blob/b681e592b88a95341e6d7bd9b33afe7d5b4438b0/ament_cmake_python/cmake/ament_python_install_package.cmake#L198

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.