ros/genmsg — Issue #1: Userfriendly error message for missing DEPENDENCIES in generate_messages
Author: mkjaergaard
Created: 2012-01-13 21:33:59+00:00
State: open

If the correct dependencies are not specified in generate_messages macro the genmsg will spit out a confusing python error. This should give a usefull error like:
"actionlib_msgs not found when generating for actionlib. Did you forget to specify actionlib_msgs in generate_messages() DEPENDENCIES" or something similar....

The current error message is:

```
--- Error parsing token: @{
import sys, genmsg, os
genmsg.base.log_verbose('GENMSG_VERBOSE' in os.environ)
# put this path at the beginning
sys.path.insert(0, genmsg_python_path)
import genmsg.deps

msg_deps = {}
for m in messages:
msg_deps[m] = genmsg.deps.find_msg_dependencies(pkg_name, m, dep_search_paths)

srv_deps = {}
for s in services:
srv_deps[s] = genmsg.deps.find_srv_dependencies(pkg_name, s, dep_search_paths)

}
if __name__ == '__main__': main()
File "/usr/bin/empy", line 3290, in main
invoke(sys.argv[1:])
File "/usr/bin/empy", line 3273, in invoke
interpreter.wrap(interpreter.file, (file, name))
File "/usr/bin/empy", line 2273, in wrap
self.fail(e)
File "/usr/bin/empy", line 2264, in wrap
apply(callable, args)
File "/usr/bin/empy", line 2337, in file
self.safe(scanner, done, locals)
File "/usr/bin/empy", line 2379, in safe
self.parse(scanner, locals)
File "/usr/bin/empy", line 2400, in parse
token.run(self, locals)
File "/usr/bin/empy", line 1410, in run
interpreter.execute(self.code, locals)
File "/usr/bin/empy", line 2580, in execute
exec statements in self.globals
File "", line 10, in
File "/home/local/catkin_build2/build/lib/genmsg/deps.py", line 17, in find_msg_dependencies
genmsg.msg_loader.load_depends(msg_context, spec, search_paths)
File "/home/local/catkin_build2/build/lib/genmsg/msg_loader.py", line 343, in load_depends
return load_msg_depends(msg_context, spec, msg_search_path)
File "/home/local/catkin_build2/build/lib/genmsg/msg_loader.py", line 320, in load_msg_depends
load_msg_depends(msg_context, depspec, search_path)
File "/home/local/catkin_build2/build/lib/genmsg/msg_loader.py", line 312, in load_msg_depends
depspec = load_msg_by_type(msg_context, resolved_type, search_path)
File "/home/local/catkin_build2/build/lib/genmsg/msg_loader.py", line 118, in load_msg_by_type
file_path = get_msg_file(package_name, base_type, search_path)
File "/home/local/catkin_build2/build/lib/genmsg/msg_loader.py", line 78, in get_msg_file
% (base_type, package, search_path))
genmsg.msg_loader.MsgNotFound: Cannot locate message [GoalID]: unknown package [actionlib_msgs] on search path [{'actionlib': '/home/local/catkin_build2/build/actionlib/actions_gen', 'std_msgs': '/home/local/catkin_build2/std_msgs/msg'}]
CMake Error at catkin/cmake/safe_execute_process.cmake:13 (message):
Error executing process with arguments COMMAND
/home/local/catkin_build2/build/env.sh /usr/bin/empy --raw-errors -F
/home/local/catkin_build2/catkin/cmake/empy_util.py -F
/home/local/catkin_build2/build/actionlib/cmake/actionlib-genmsg-context.py
-F /home/local/catkin_build2/build/catkin/catkin-context.py -o
/home/local/catkin_build2/build/actionlib/cmake/actionlib-genmsg.cmake
/home/local/catkin_build2/genmsg/cmake/pkg-genmsg.cmake.em
Call Stack (most recent call first):
catkin/cmake/em_expand.cmake:14 (safe_execute_process)
build/cmake/genmsg/genmsg-extras.cmake:101 (em_expand)
actionlib/CMakeLists.txt:28 (generate_messages)
```