catkin_tools
catkin_tools copied to clipboard
PYTHONPATH problems when extending workspace that has an install space
System Info
- Operating System: Linux 4.15.0-36-generic 39~16.04.1-Ubuntu SMP Tue Sep 25 08:59:23 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
- Python Version: 2.7.12
- Version of catkin_tools: 0.4.4
- ROS Distro: kinetic
Build / Run Issue
I have two workspaces, stable_ws with an install space in /opt/ros/stable_ws and devel_ws which is extending the former. Unfortunately, whenever I make changes to the source code in my devel_ws, the code that gets imported is the one in /opt/ros/stable_ws.
Expected Behavior
Whenever I make changes in the devel_ws, those changes should be the ones being run, i.e. the PYTHONPATH should have the following order:
devel_ws/devel:/opt/ros/stable_ws:/opt/ros/kinetic
Actual Behavior
Sourcing /opt/ros/stable_ws/setup.zsh makes the PYHTONPATH:
/opt/ros/stable_ws/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/argen/stable_ws/devel/lib/python2.7/dist-packages
Sourcing devel_ws/devel/setup.zsh, my PYHTONPATH looks like this:
/opt/ros/stable_ws/lib/python2.7/dist-packages:/home/argen/devel_ws/devel/lib/python2.7/dist-packages:/opt/ros/stable_ws/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages
Since the stable_ws is being imported at the beginning of the list, the changes in devel_ws are not being used.
Steps to Reproduce the Issue
I created a toy example, where I cloned the ros tutorials on both workspaces (stable and devel), here are their configs:
--------------------------------------------------------
Profile: default
Extending: [explicit] /opt/ros/kinetic
Workspace: /home/argen/stable_ws
--------------------------------------------------------
Source Space: [exists] /home/argen/stable_ws/src
Log Space: [exists] /home/argen/stable_ws/logs
Build Space: [exists] /home/argen/stable_ws/build
Devel Space: [exists] /home/argen/stable_ws/devel
Install Space: [exists] /opt/ros/stable_ws
DESTDIR: [unused] None
--------------------------------------------------------
Devel Space Layout: linked
Install Space Layout: merged
--------------------------------------------------------
Additional CMake Args: None
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False
--------------------------------------------------------
Whitelisted Packages: None
Blacklisted Packages: None
--------------------------------------------------------
Workspace configuration appears valid.
--------------------------------------------------------
---------------------------------------------------------
Profile: default
Extending: [explicit] /opt/ros/stable_ws
Workspace: /home/argen/devel_ws
---------------------------------------------------------
Source Space: [exists] /home/argen/devel_ws/src
Log Space: [exists] /home/argen/devel_ws/logs
Build Space: [exists] /home/argen/devel_ws/build
Devel Space: [exists] /home/argen/devel_ws/devel
Install Space: [unused] /home/argen/devel_ws/install
DESTDIR: [unused] None
---------------------------------------------------------
Devel Space Layout: linked
Install Space Layout: None
---------------------------------------------------------
Additional CMake Args: None
Additional Make Args: None
Additional catkin Make Args: None
Internal Make Job Server: True
Cache Job Environments: False
---------------------------------------------------------
Whitelisted Packages: None
Blacklisted Packages: None
---------------------------------------------------------
Workspace configuration appears valid.
---------------------------------------------------------
However, I was not able to reproduce my problem with this toy setup; the PYHTONPATH after sourcing devel_ws seems correct:
/home/argen/devel_ws/devel/lib/python2.7/dist-packages:/opt/ros/stable_ws/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages:/home/argen/stable_ws/devel/lib/python2.7/dist-packages
Any clues on what I could have messed up configuring my non-toy setup? The configs look exactly the same, but my workspaces have many more repositories. Is there anything else I can check?
Thanks!