-
Notifications
You must be signed in to change notification settings - Fork 280
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
Graceful failure when envoking catkin_make from wrong directory #328
Comments
rosmake-like global invocation of catkin_make is not currently possible, not even part of the current catkin design. See #304. I believe there already once was a request to prevent catkin_make from running when the current folder did not contain a src folder, or contained a package.xml. Generally these heuristics are not perfect however, it would be better if catkin_make checked that the source space it uses has a valid catkin CMakeLists.txt, whatever that means. |
If the catkin workspace root always lacks a CMakeFiles.txt, most of the subdirectories the novice user will be in will have CMakeFiles.txt. The following patch works if this is the case: --- /home/teh/tmp/catkin_make 2013-01-22 17:00:20.632605653 +0100
+++ /opt/ros/groovy/bin/catkin_make 2013-01-22 17:11:30.939046371 +0100
@@ -26,6 +26,12 @@
return 'The specified base path "%s" does not exist' % base_path
print('Base path: %s' % base_path)
+ # test if we are in subdirectory of workspace
+ if os.path.exists(os.path.join(base_path,'CMakeLists.txt')):
+ retstr = 'You appear to be in a package directory\n'
+ retstr += 'Run catkin_make from your catkin workspace root directory!'
+ return retstr
+
# determine source space
source_path = os.path.join(base_path, 'src')
if args.source: |
My problem was that global invocation of catkin_make IS possible (ie it's in the os execution path) but the fact that it behaves correctly only when invoked from a specific location was not well enough documented. I suspect that even when it is well documented it will still be a trap for new users. |
Sure, what I meant was "global invocation of catkin that does something useful". That's not possible, but could be possible with e.g. an advertised build space in the development environment. |
I followed the catkin tutorials and lost a bit of time trying to understand why nothing was working when executing the following sequence.
catkin_make happily created a new workspace in place which to me, a newb, looked plausible. Of course no amount of catkin_make/cmake/make was useful from ~/catkin_ws/src/beginner_tutorials/
It would be great if catkin_make would either have an explicit command to create a new workspace or check whether it's located in a workspace and give the user a hint...
The text was updated successfully, but these errors were encountered: