Skip to content
This repository was archived by the owner on Nov 9, 2022. It is now read-only.

Commit 9edcf54

Browse files
committed
Fix for genjava ignoring most packages in standalone mode
The genjava_message_artifacts tool in package genjava calls rosjava_build_tools.catkin.index_message_package_dependencies_from_local_environment() to generate a list of all message packages and their dependencies in topological order from the list of package names given in the command line. Especially in cases where ROS_PACKAGE_PATH lists the package paths for each individual package separately, which is the case in isolated builds using catkin_make_isolated or catkin_tools, the relative path returned by catkin_pkg.packages.find_packages() is only `.`. In general, the relative package path is not unique, but it is used as key of a dictionary when passed to topological_order_packages a few lines below. As a consequence, all packages but one of each group that have the same relative package path were missing in the returned list and hence no artifacts were generated by genjava_message_artifacts. This patch adds a line that transforms the relative to the absolute package path, avoiding the above problem.
1 parent 25723ff commit 9edcf54

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rosjava_build_tools/catkin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def index_message_package_dependencies_from_local_environment(package_name_list=
5252
# i.e. no duplicates!
5353
for path in reversed(package_paths):
5454
for package_path, package in catkin_pkg.packages.find_packages(path).items():
55+
# resolve and normalize absolute path because it is used as a key below
56+
package_path = os.path.normpath(os.path.join(path, package_path))
5557
all_packages[package.name] = (package_path, package)
5658
if has_build_depend_on_message_generation(package) or package.name in message_package_whitelist:
5759
if package_name_list:

0 commit comments

Comments
 (0)