question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

catkin build with linked develspace and install: true causes source devel/setup.bash to not work

See original GitHub issue

System 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 customized osrf/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:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
timonegkcommented, Jul 13, 2021

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:

Error: This workspace was built with the '--install' option.
       You should source the setup files in the install space instead.
       Your environment has not been changed.

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.

0reactions
timonegkcommented, Apr 19, 2022

Sorry it took so long. I added a patch in #725. The issue was that there is a .catkin file in the devel folder that is used to generate ROS_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 via pip install git+https://github.com/catkin/catkin_tools@fix_devel_install

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error with catkin build with ds4_driver - ROS Answers
After disabling the install space, cleaning and rebuilding the workspace, things started working again, even after source devel/setup.bash .
Read more >
Workspace Mechanics — catkin_tools 0.0.0 documentation
Devel Space – The subdirectory containing the final build products which can be used to run code, but relies on the presence of...
Read more >
F1/10 Autonomous Racing - GitHub Pages
If they are not then you might need to 'source' some setup. ... Lets create and build a catkin workspace - similar to...
Read more >
Catkin-Pip. - Read the Docs
source devel/setup.bash ... When used to create an install space, catkin-pip doesnt do anything ... ists, and if it is not there yet....
Read more >
ROS Answers: Open Source Q&A Forum - RSS feed
Previous Why do we need the devel, build and install spaces in a catkin ... files of A. But I can't source A...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found