Colcon fails to build Python package: "error in 'egg_base'"
After I ran an apt upgrade
this morning, Colcon fails to build ROS2 Python packages from source with the following error:
$ colcon build --packages-up-to joint_state_publisher
Starting >>> joint_state_publisher
--- stderr: joint_state_publisher
error: error in 'egg_base' option: '../../../build/joint_state_publisher' does not exist or is not a directory
---
Failed <<< joint_state_publisher [0.44s, exited with code 1]
Summary: 0 packages finished [0.76s]
1 package failed: joint_state_publisher
1 package had stderr output: joint_state_publisher
I am using this branch: https://github.com/ros/joint_state_pu...
Based on some of the other results from searching for this error (such as this one: https://answers.ros.org/question/3091...) I think this might be related to parsing the package's setup.py
file, rather than something necessarily ROS-specific.
I have the same problem. In my case, the issue is caused by the fact that I used symbolic links from the workspace src folder to the actual sources. Without symbolic links, the issue does not seem to occur. Can you confirm if this is the same for you?
@mheidingsfeld I indeed can confirm this. I just tried copying packages instead of using links and I am not getitng this issue anymore
To me this seem to be an issue with colcon and Python packages. It can be easily reproduced with this minimal example:
@mheidingsfeld I can duplicate your minimal example, and I get the same error as I did previously.
In my original case, my project
src
directory was symlinked to thesrc
directory of a different workspace (an important detail that had slipped my mind, since I'd set up this workspace months and months ago). I made a minimal example to test this situation, and I discovered that if I build the workspace containing the non-symlinked directory first, the workspace containing the symlinked directory succeeds.This works:
This fails:
I am facing the exact same problem, also having a symlinked workspace. I know the setup worked months ago, most likely with an older colcon version.
I create an issue about this here: https://github.com/colcon/colcon-core...