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

Userfriendly error message for missing DEPENDENCIES in generate_messages #1

Closed
mkjaergaard opened this issue Jan 13, 2012 · 5 comments
Assignees

Comments

@mkjaergaard
Copy link
Member

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 "<string>", line 10, in <module>
  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)
@ghost ghost assigned mkjaergaard Jan 13, 2012
@dawonn
Copy link

dawonn commented Feb 14, 2013

agreed, especially for someone new to catkin who is pretty sure he included all the proper depend strings and is very confused as to why it is 'missing'..... /le sigh...

@jbohren
Copy link
Member

jbohren commented Mar 14, 2013

Three months after the groovy release I find myself adding the documentation to actually build a real package that generates ROS messages that depend on other messages...

@jbohren
Copy link
Member

jbohren commented Mar 14, 2013

Not to mention the fact that "std_msgs" is mentioned in the following places if you want to use something in std_msgs in a message that you generate:

<build_depend>std_msgs</build_depend>
<run_depend>std_msgs</run_depend>
find_package(catkin REQUIRED COMPONENTS std_msgs)
#...
generate_messages(DEPENDENCIES std_msgs)
#...
catkin_package(CATKIN_DEPENDS std_msgs)

Yes I understand this is a catkin issue as much as it's a genmsg issue. @tkruse

@jbohren
Copy link
Member

jbohren commented Mar 14, 2013

I am surprised that generate_messages() automatically creates install targets for the messages. It's uncharacteristically user-friendly in that regard.

@ghost ghost assigned dirk-thomas Jun 5, 2013
@jbohren
Copy link
Member

jbohren commented Jun 5, 2013

Thanks!

PierrickKoch referenced this issue in PierrickKoch/robotpkg Feb 21, 2014
Changes since 0.3.10:

0.4.20 (2013-06-18)
-------------------
* generate pkg config extra files containing variables which list all message
  and service files (`#28 <https://github.com/ros/genmsg/issues/28>`_)

0.4.19 (2013-06-06)
-------------------
* improve error message for missing message dependencies
  (`#1 <https://github.com/ros/genmsg/issues/1>`_)
* fix generating duplicate include dirs for multiple add_message_files()
  invocations which broke generated lisp messages
  (`#27 <https://github.com/ros/genmsg/issues/27>`_)

0.4.18 (2013-03-08)
-------------------
* fix handling spaces in folder names
  (`ros/catkin#375 <https://github.com/ros/catkin/issues/375>`_)
* add targets with _generate_messages_LANG suffix
  (`#20 <https://github.com/ros/genmsg/issues/20>`_)
* pass all message generation target to EXPORTED_TARGETS
  (`#26 <https://github.com/ros/genmsg/issues/26>`_)
* improve error messages (`#22 <https://github.com/ros/genmsg/issues/22>`_)

0.4.17 (2013-01-19)
-------------------
* fix bug using ARGV in list(FIND) directly
  (`#18 <https://github.com/ros/genmsg/issues/18>`_)

0.4.16 (2013-01-13)
-------------------
* hide transitive message dependencies and pull them in automatically
  (`#15 <https://github.com/ros/genmsg/issues/15>`_)

0.4.15 (2012-12-21)
-------------------
* first public release for Groovy
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

4 participants