catkin build with linked develspace and install: true causes source devel/setup.bash to not work
See original GitHub issueSystem Info
- Operating System:
Linux starfruit 5.8.0-48-generic #54~20.04.1-Ubuntu SMP Sat Mar 20 13:40:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
(actually running inside a customizedosrf/ros:noetic-desktop-full-focal
docker container) - Python Version:
Python 3.8.2
- Version of catkin_tools:
0.5.0
- ROS Distro:
noetic
Build / Run Issue
- Works with
catkin_make
- Works with
catkin_make_isolated --merge
- Works with
catkin build
- Works with
catkin build -p1
So I have seen #376 and I have a very similar issue still, with a slightly different config. It’s entirely possible that I’m using develspace and installspace incorrectly. I actually forked the example repo from that issue here: https://github.com/shuhaowu/catkin_tools_test_ws
The difference is that the default profile has install: true
, which in my understanding would generate an installspace that I can then tarball around. My understanding is that this config would also generate a develspace, and if I source devel/setup.bash
, then I be able to run the packages I’m building locally.
Except, this is not happening:
catkin build --profile default
. devel/setup.sh
rosrun py_dummy_pkg dummy.py
This gives: [rospack] Error: package 'py_dummy_pkg' not found
, like the original author.
If we set install: false
, then the package can be found and used.
Expected Behavior
I expect that source devel/setup.bash
would setup the packages for development, despite install: true
. Is this the wrong expectation?
Workaround
Create a second profile that does install: true
, separate from the default profile with install = false. I also put all the spaces into a subfolder so things don’t collide:
build_space: install/build
devel_space: install/devel
install_space: install/install
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top GitHub Comments
Okay, I can now reproduce the problem, there previously was a problem on my side. The issue indeed seems to be that a linked devel space cannot be sourced when an install space is present. So the “official fix” would be to source the install space instead. For the isolated devel space, there is an error message when sourcing the devel space:
For the merged devel space, sourcing the devel space works even when an install space is present. I am not entirely sure why the behavior differs for the different devel space layouts and what the behavior for the linked devel space should be, but I will look into it.
Sorry it took so long. I added a patch in #725. The issue was that there is a
.catkin
file in thedevel
folder that is used to generateROS_PACKAGE_PATH
and it was only generated when not installing. Could you test the patch and look if it resolves the problem for you as well? You can install it directly with pip viapip install git+https://github.com/catkin/catkin_tools@fix_devel_install