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

catkin build <pkg> succeeds only first time with clean ws #173

Closed
fferri opened this issue Mar 26, 2015 · 11 comments
Closed

catkin build <pkg> succeeds only first time with clean ws #173

fferri opened this issue Mar 26, 2015 · 11 comments

Comments

@fferri
Copy link

fferri commented Mar 26, 2015

I'm using catkin-tools for compiling a very simple ws.
I created ws dir, ran catkin init inside it, then copied the pkgs dirs.

Here's an overview of the content (not showing lots of files at depth > 3)

$ cd vrep_ws
$ find . -maxdepth 3
.
./.catkin_tools
./.catkin_tools/default
./.catkin_tools/default/build.yaml
./.catkin_tools/README
./src
./src/.catkin_tools
./src/.catkin_tools/README
./src/vrep_common
./src/vrep_common/CMakeLists.txt
./src/vrep_common/mainpage.dox
./src/vrep_common/msg
./src/vrep_common/package.xml
./src/vrep_common/srv
./src/vrep_plugin
./src/vrep_plugin/CMakeLists.txt
./src/vrep_plugin/include
./src/vrep_plugin/mainpage.dox
./src/vrep_plugin/package.xml
./src/vrep_plugin/src

Now, if I run catkin build vrep_plugin, it correctly builds the package (kudos for integrating with OSX Notification Center :-) ).

After modifying the sources, and building again, with the same command, I get:

$ catkin build vrep_plugin
Traceback (most recent call last):
  File "/usr/local/bin/catkin", line 9, in <module>
    load_entry_point('catkin-tools==0.2.2', 'console_scripts', 'catkin')()
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/commands/catkin.py", line 198, in main
    sys.exit(args.main(args) or 0)
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/verbs/catkin_build/cli.py", line 220, in main
    ctx = Context.Load(opts.workspace, opts.profile, opts)
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/context.py", line 134, in Load
    return Context(**context_args)
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/context.py", line 242, in __init__
    sticky_env = get_resultspace_environment(self.devel_space_abs, quiet=True)
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/resultspace.py", line 73, in get_resultspace_environment
    for line in run_command(command, cwd=os.getcwd()):
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/runner/run_unix.py", line 45, in run_command
    p = Popen(cmd, stdin=slave, stdout=slave, stderr=STDOUT, cwd=cwd, universal_newlines=True)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

If I remove build and devel directory, it will of course build again correctly.

P.S.: my platform: ROS Indigo on OS X Yosemite built with Homebrew according to https://gist.github.com/mikepurvis/9837958

@jbohren
Copy link
Contributor

jbohren commented Mar 26, 2015

I'm pretty sure this is related to #87.

Can you post the contents of the develspace?

@wjwwood
Copy link
Member

wjwwood commented Mar 26, 2015

@fferri can you post the output of catkin build vrep_plugin -n?

@fferri
Copy link
Author

fferri commented Mar 26, 2015

On a clean workspace:

$ catkin build vrep_plugin -n
--------------------------------------------------------
Profile:                     default
Extending:             [env] /opt/ros/indigo
Workspace:                   /Users/user/vrep_ws
Source Space:       [exists] /Users/user/vrep_ws/src
Build Space:       [missing] /Users/user/vrep_ws/build
Devel Space:       [missing] /Users/user/vrep_ws/devel
Install Space:     [missing] /Users/user/vrep_ws/install
DESTDIR:                     None
--------------------------------------------------------
Isolate Develspaces:         False
Install Packages:            False
Isolate Installs:            False
--------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
--------------------------------------------------------
Workspace configuration appears valid.
--------------------------------------------------------
Found '2' packages in 0.0 seconds.
Packages to be built:
- vrep_common (catkin)
- vrep_plugin (catkin)
Total packages: 2

After building:

$ catkin build vrep_plugin -n
Traceback (most recent call last):
  File "/usr/local/bin/catkin", line 9, in <module>
    load_entry_point('catkin-tools==0.2.2', 'console_scripts', 'catkin')()
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/commands/catkin.py", line 198, in main
    sys.exit(args.main(args) or 0)
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/verbs/catkin_build/cli.py", line 220, in main
    ctx = Context.Load(opts.workspace, opts.profile, opts)
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/context.py", line 134, in Load
    return Context(**context_args)
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/context.py", line 242, in __init__
    sticky_env = get_resultspace_environment(self.devel_space_abs, quiet=True)
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/resultspace.py", line 73, in get_resultspace_environment
    for line in run_command(command, cwd=os.getcwd()):
  File "/usr/local/lib/python2.7/site-packages/catkin_tools/runner/run_unix.py", line 45, in run_command
    p = Popen(cmd, stdin=slave, stdout=slave, stderr=STDOUT, cwd=cwd, universal_newlines=True)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

@fferri
Copy link
Author

fferri commented Mar 26, 2015

@jbohren you want the entire contents? I can send you a zip via email...

@fferri
Copy link
Author

fferri commented Mar 26, 2015

@jbohren or you maybe wanted to just see the filenames?
Does this help?

$ find vrep_ws/devel -maxdepth 2
vrep_ws/devel
vrep_ws/devel/.catkin
vrep_ws/devel/.rosinstall
vrep_ws/devel/_setup_util.py
vrep_ws/devel/env.sh
vrep_ws/devel/etc
vrep_ws/devel/etc/catkin
vrep_ws/devel/include
vrep_ws/devel/include/vrep_common
vrep_ws/devel/lib
vrep_ws/devel/lib/libv_repExtRos.dylib
vrep_ws/devel/lib/pkgconfig
vrep_ws/devel/lib/python2.7
vrep_ws/devel/setup.bash
vrep_ws/devel/setup.sh
vrep_ws/devel/setup.zsh
vrep_ws/devel/share
vrep_ws/devel/share/common-lisp
vrep_ws/devel/share/vrep_common
vrep_ws/devel/share/vrep_plugin

@jbohren
Copy link
Contributor

jbohren commented Mar 26, 2015

@fferri Yeah, that's helpful. What shell are you using?

@fferri
Copy link
Author

fferri commented Mar 26, 2015

@jbohren $ echo $SHELL
/usr/local/bin/bash
$ /usr/local/bin/bash --version
GNU bash, version 4.3.33(1)-release (x86_64-apple-darwin14.1.0)

@jbohren
Copy link
Contributor

jbohren commented Mar 26, 2015

@wjwwood
Copy link
Member

wjwwood commented Mar 26, 2015

@jbohren on an unrelated note, that should use the fully qualified CMAKE_EXECUTABLE like the build verb uses. Also you should avoid using the shell and gnu tools when possible. It's easy enough to replace use of | sort with sorting in Python.

@jbohren
Copy link
Contributor

jbohren commented Mar 26, 2015

I think what's happening is without sourcing your bashrc in the subshel, it's not finding the cmake executable. Try: this pr: #174

@fferri
Copy link
Author

fferri commented Mar 26, 2015

@jbohren yup, #174 fixes this issue :-)

jbohren added a commit to jbohren-forks/catkin_tools that referenced this issue Mar 26, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants