Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Generate .catkin file when using merged develspace and catkin in "parallel-safe" mode #78

Closed
jbohren opened this issue Jul 2, 2014 · 16 comments

Comments

@jbohren
Copy link
Contributor

jbohren commented Jul 2, 2014

If catkin gets a "parallel-safe" mode, as described in ros/catkin/issues/675, then we could use that to generate a .catkin develspace marker file from the information generated by the process described in ros/catkin/issues/674.

@wjwwood
Copy link
Member

wjwwood commented Jul 2, 2014

Thanks for keeping track of this issue and for looking into it originally. I really appreciate the help.

@jbohren jbohren added this to the Recommend Switch from CM / CMI milestone Jun 11, 2015
@jbohren jbohren added the bug label Jun 11, 2015
@jonbinney
Copy link

This is still a problem, and in my opion is a pretty big problem with catkin tools right now. Sometimes after running catkin build and sourcing devel/setup.bash, some packages are not in my ROS_PACKAGE_PATH. This has been happening to me and my coworkers for months, and I only yesterday figured out that it was due to the concurrency problems in catkin tools.

Here's a test script that will generate a workspace with a bunch of packages and try to elicit the problem: https://gist.github.com/jonbinney/0a09e57db3676e0bd29f
That scripts compiles a workspace with 20 packages 100 times. On my computer, it caused a corrupted devel/.catkin (and thus a corrupted ROS_PACKAGE_PATH) 12/100 times.

Note that while having lots of packages and having a carefully crafted cmakelists.txt in the test script causes the bug to happen more often, the bug exists for any workspace. In practice I run into this bug several times a week during normal ROS development.

@wjwwood
Copy link
Member

wjwwood commented Nov 10, 2015

@jonbinney did you ever run this with the --isolated-devel option? My guess is that this issue would not be present in that case. But obviously the isolated devel space is not very nice to use.

These are the solutions as I see them:

The first option is tied up in the #196 pr, which is going slowly, and the second option seems like a lot of work. I'd say that the best short term solution would be to implement the work around of option 3 and then replace it with option 1 when #196 gets merged. I don't have time to implement the work around, but maybe a pioneering individual would be willing to make the patch.

@jonbinney
Copy link

@wjwwood I was testing catkin build with no options. --isolated-devel doesn't seem to be an option for catkin build (at least according to the help text)

@wjwwood
Copy link
Member

wjwwood commented Nov 10, 2015

@jonbinney You have to set it with catkin config --isolate-devel before doing catkin build.

@jonbinney
Copy link

Running test now with --isolate-devel. So far so good.

@jonbinney
Copy link

Confirmed, works 100 times out of 100 with --isolate-devel!

@jonbinney
Copy link

Another option would be to make --isolate-devel the default for now. That would make things slow, but if people need fast they should be using catkin_make directly right now.

@wjwwood
Copy link
Member

wjwwood commented Nov 11, 2015

Aside from being slow --isolated-devel is inconvenient to use (in my opinion). Yet another option is to make --install the default, and users can use the install space. I believe that would also not have the problem (certainly not when using --isolated-devel but also perhaps with out --isolated-devel too).

@jack-oquin
Copy link

An added advantage of --install might be the fact that the ament design uses install space and not devel.

@jonbinney
Copy link

I'm fine with install, as long as the devel space is gone. My biggest concern is that right now most people run catkin build; . devel/setup.bash, which results in bad builds sometimes. Whatever change is made should make sure that either those commands always result in a valid setup, or that users are forced to change their behavior.

@NikolausDemmel
Copy link
Member

-1 for making --install the default.

The devel space has many advandtages over install for developers (in particular for Python), and we are talking about mostly developer users for now, I presume. I would guess that many defs have come to rely on them, even if they might not be aware of the mechanics. I have not come across a signle instance of someone actually using the install space for development (for anything, really, except maybe for from-source installs of a base ROS system) in daily work. Moreover, I frequently come across (unreleased) packages that are not properly configured for installation and thus only work with the devel space as-is. Thus making --install the default might take quite a few by surprise.

I wounder how much effort @wjwwood's third suggestion would really be. I haven't dug into it, but I guess all the code for manipulating the .catkin file has to be there already. Patching it up post-build should be pretty straight-forward. What I'm less sure about is what to do when the build fails or is aborted, but maybe "nothing" is enough for this workaround. I.e. the workaround only takes effect when the build succeeds.

An added advantage of --install might be the fact that the ament design uses install space and not devel.

This makes me wounder how easy it would be to extend catkin / catkin_tools to support linked install spaces like ament, but that is a different story.

@jbohren
Copy link
Contributor Author

jbohren commented Nov 12, 2015

@NikolausDemmel My PR (#196) already implements a linked devel space, so creating a linked install space wouldn't be a big leap.

@wjwwood
Copy link
Member

wjwwood commented Nov 12, 2015

-1 for making --install the default.

You're right, without the symlink install option it would be inconvenient to use.

@NikolausDemmel My PR (#196) already implements a linked devel space, so creating a linked install space wouldn't be a big leap.

I'm not sure about this, since what I think you're talking about it is doing an isolated install and then do a symlink to a common folder, but that doesn't make it so that you can edit Python files without re-installing. What I think @NikolausDemmel is talking about is how ament cmake packages can replace the cmake install step with symlinking, so the files it installs are just symlinks to either the build folder or the source folder.

@jbohren
Copy link
Contributor Author

jbohren commented Jan 25, 2016

@wjwwood Can we close this now that master is populating the .catkin file on it's own?

@wjwwood
Copy link
Member

wjwwood commented Jan 25, 2016

Sure.

@wjwwood wjwwood closed this as completed Jan 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants