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

[bazel] Unable to use workspaces with underscores in name? #348

Open
EricCousineau-TRI opened this issue May 8, 2024 · 1 comment
Open
Assignees

Comments

@EricCousineau-TRI
Copy link
Collaborator

I am debugging a performance regression in ROS 2 Debians.
As I'm doing this, I'm using timeshift to backup / restore things, so I have an "old and good" install of /opt/ros/humble, and a "new and bad" install of /opt/ros/humble.
I want to swap back and forth by changing the workspace path.

On latest main (955245e), the following works:

cd drake-ros/ros2_example_bazel_installed
export ROS2_DISTRO_PREFIX=/opt/ros/humble
bazel fetch @ros2//...

However, the following fails on latest main (955245e):

sudo ln -s /opt/ros/humble /opt/ros/humble_old
cd drake-ros/ros2_example_bazel_installed
export ROS2_DISTRO_PREFIX=/opt/ros/humble_old
bazel fetch @ros2//...

The failure states:

...
        File "{output_base}/external/ros2/BUILD.bazel", line 11, column 16, in <toplevel>
                share_filegroup(
        File "{output_base}/external/ros2/tools/common.bzl", line 8, column 45, in share_filegroup
                srcs = [path for path in native.glob(
Error in glob: pattern cannot be absolute

Looking at $(bazel info output_base)/external/ros2/BUILD.bazel, I see this around line 11:

share_filegroup(
    name = "ament_cmake_core_share",
    share_directories = ["/opt/ros/humble/share/ament_cmake_core", "/opt/ros/humble/share/ament_index"],
)

Somehow, we're just ignoring the user specified directory?

@EricCousineau-TRI
Copy link
Collaborator Author

EricCousineau-TRI commented May 8, 2024

Ah, from looking at code, looks like it's from CMAKE_PREFIX_PATH, which may be baked into the installation.

But it's not yet clear to me how we map /opt/ros/humble to _opt_ros_humble in the nominal case. Still need to find that.

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

1 participant