-
Notifications
You must be signed in to change notification settings - Fork 36
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
[bazel] rosbag is unable to record custom types #311
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Here's an automated reproduction, with what we believe should be the right data declarations not working: |
To narrow the scope initially, I would like to know what we are missing in our Bazel runfiles that should make Once we identify what's missing and perhaps a hacky way to fix it (e.g. "just copy these files"), then someone from TRI can make the adjustments to our Bazel mechanics. |
Another data point, this relevant test passes when run (either as an executable or test) from
which uses the
|
BTW Running under |
The expectation from #312 is that those same |
Looking into this, something funny happening with ament index here :
Tried so far :
|
For the In |
@adityapande-1995 Were you able to turn up anything by comparing @kunimatsu-tri In Anzu, we have a root-level roll-up target, We can add this any time, but I don't believe I'll have time this week. |
Thanks, Eric. I'll ignore that one for now. FYI, I tried running
And this is just one of tons of similar errors. |
Yeah I did run it. The libs that come from the original ros2 archive live in that path that @kunimatsu-tri mentioned, but in our case it lives in ros2_example_apps, as it is a "new" package that we wrote. I suspect either the shared lib for the message is in the wrong path, or it is looking for it in the wrong path. AMENT_PREFIX_PATH should handle that, but modifying it did not help. Continuing investigation. |
Gotcha. Can you post a GitHub gist of the Also, I would assume that a shared library should be loaded according to |
Yup will do. Its like 40k lines of trace haha. Debug progress so far : TL;DR :
Procedure followed :
and
Run this in a new terminal to give you a shell access :
Then try to record using : SuspectsLooking at drake-ros/bazel_ros2_rules/ros2/rosidl.bzl Lines 1168 to 1180 in 0495f68
|
Relevant strace logs after copying the correct libs over (after following the Procedure above) :
So it does find it, working on fixing the missing symbol. |
Alright I got it working, by force loading the library using Inside the bash in the sandbox :
|
Having some trouble making the test work here with the hack. For now, if this is a blocker, the following wrapper will work for In
And in
Start the recorder using Action items :
|
Thanks! That being said, I am still confused why Can you point out, in source code, where this (broken?) assumption of |
My guess here is that On checking the ros2 archive, I see all of them contain the |
@adityapande-1995 and me are working on this solution that we are trying to explore which is the following def _copy_typesupport_libs_impl(ctx):
my_path = paths.join(
ctx.attr.prefix,
"lib/lib" + ctx.attr.pkgname + ".so",
)
temp_path = paths.join(
ctx.attr.prefix,
"lib/lib" + ctx.attr.pkgname + ".hello",
)
temp_file = ctx.actions.declare_file(temp_path)
ctx.actions.write(
output = temp_file,
content = "",
)
runfiles_symlinks = {
my_path : ctx.file.libdep,
temp_path : temp_file
}
return [
AmentIndex(prefix = ctx.attr.prefix),
DefaultInfo(
runfiles = ctx.runfiles(root_symlinks = runfiles_symlinks),
),
]
copy_typesupport_libs = rule(
attrs = dict(
pkgname = attr.string(mandatory = True),
prefix = attr.string(default = "rosidl_generate_ament_index_entry"),
libdep = attr.label(
mandatory = True,
allow_single_file = True,
),
),
implementation = _copy_typesupport_libs_impl,
output_to_genfiles = True,
provides = [AmentIndex],
) and then added this rule copy_typesupport_libs(
name = name + "_copy_libs",
pkgname = name, "__rosidl_typesupport_cpp",
libdep = ":" +_make_public_name(name, "__rosidl_typesupport_cpp"),
**kwargs
) here drake-ros/bazel_ros2_rules/ros2/rosidl.bzl Line 1181 in ce913f7 The .hello files show up on running bazel build //ros2_example_common:ros2_example_common_msgs_copy_libs but not the .so ones. Not really sure why the .so file is not showing up. |
Is there a way to get logs or some verbosity on why one step fails and the other doesn't ? Theres no error thrown. |
Fixed by #317 |
Raised an issue upstream : ros2/rosbag2#1517 |
@kunimatsu-tri and I ran into this on Anzu. Kuni and I will work to produce an example for this repository.
@calderpg-tri @IanTheEngineer Can I ask for some time from someone at OSRC to look at this?
It seems specific to how rosbag is attempting to load IDL support at runtime in ways that do not work with the current Bazel runfiles layout.
The text was updated successfully, but these errors were encountered: