Skip to content

Conversation

Tacha-S
Copy link

@Tacha-S Tacha-S commented Oct 6, 2025

Use libyaml vendor for building moveit_task_constructor_visualization package.

@rhaschke
Copy link
Contributor

rhaschke commented Oct 6, 2025

As you can see here, the code builds without issues. The yaml dependency was optional. I'm wondering why you got the build error. Maybe you had installed libyaml-0-2, but not libyaml-dev?
In any case you should target a main development branch, i.e. ros2 or ideally master.

@rhaschke rhaschke changed the title Fix yaml depends Make yaml dependency mandatory Oct 6, 2025
@Tacha-S
Copy link
Author

Tacha-S commented Oct 6, 2025

Both packages are installed, and libyaml-0-2 cannot be removed because it’s required by other dependencies.

libyaml-0-2/noble,now 0.2.5-1build1 amd64 [installed,automatic]
  Fast YAML 1.1 parser and emitter library
libyaml-dev/noble,now 0.2.5-1build1 amd64 [installed,automatic]
  Fast YAML 1.1 parser and emitter library (development)

Although YAML is an optional dependency, it seems the linker still finds libyaml-0-2, which causes the linking error.
Also, even without YAML, there’s still a build error because rviz::StringProperty exists in a different namespace.
For ROS packages, it’s better to use libyaml_vendor, since that avoids environment-dependent issues.

I can recreate the PR targeting the ros2 or main branch, but if you’re willing to backport it to Jazzy, I’ll handle it.

@rhaschke
Copy link
Contributor

rhaschke commented Oct 6, 2025

I still don't understand the origin of your linking issue. If both packages are available, the build does succeed.
The vendor packages just ensure that the wrapped library is installed. They primarily serve Windows builds, were the library needs to be build from source.

@Tacha-S
Copy link
Author

Tacha-S commented Oct 6, 2025

Even when I build inside the ros:jazzy container and run rosdep install, I get the same issue.
It only started happening around last week, so maybe the MoveIt container using CI is outdated?

@rhaschke
Copy link
Contributor

rhaschke commented Oct 6, 2025

I just rebuild within a freshly downloaded ros:jazzy-ros-core container - without the described issues.
Instead, I ran into this:

/usr/bin/ld: warning: libgz-math7.so.7, needed by /opt/ros/jazzy/lib/librviz_default_plugins.so, not found (try using -rpath or -rpath-link)
/usr/bin/ld: /opt/ros/jazzy/lib/librviz_default_plugins.so: undefined reference to `gz::math::v7::Angle::Normalize()'
/usr/bin/ld: /opt/ros/jazzy/lib/librviz_default_plugins.so: undefined reference to `gz::math::v7::Angle::Radian() const'
collect2: error: ld returned 1 exit status

... and had to manually install ros-jazzy-ros-gz.

@Tacha-S
Copy link
Author

Tacha-S commented Oct 8, 2025

I was also a bit mistaken.
Here’s how to reproduce it:

docker pull ros:jazzy
docker run --name mtc -it ros:jazzy
apt update
apt install ros-jazzy-ros-gz ros-jazzy-libcamera
mkdir -p ws/src
docker cp moveit_task_constructor mtc:ws/src   # (from host PC)
cd ws
rosdep install --from-paths . -yir
source /opt/ros/jazzy/setup.bash
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to moveit_task_constructor_visualization

This reproduces the issue.

@rhaschke
Copy link
Contributor

rhaschke commented Oct 8, 2025

Still can't reproduce the issue. I'm also wondering, why you don't have issues with libgz-math7.so.7.
I had to manually augment LD_LIBRARY_PATH with /opt/ros/jazzy/opt/gz_math_vendor/lib.
ros:jazzy for me has digest id 6616419d6752d8ef5822f774332a6d845ef909b9f28454428b4dadacf83f4d6f and is 17 months old.

@Tacha-S
Copy link
Author

Tacha-S commented Oct 8, 2025

I ran into the same issue with libgz-math7.so.7, so I installed ros-jazzy-ros-gz and explicitly re-sourced /opt/ros/jazzy/setup.bash.

@rhaschke
Copy link
Contributor

rhaschke commented Oct 9, 2025

Ok. Resourcing /opt/ros/jazzy/setup.bash indeed resolves the gz-math issue. Still, I don't see a yaml build issue.
I'm doing: docker run -it -v $PWD/mtc:/tmp/ws/src/mtc ros:jazzy and within the container:

apt update
apt install ros-jazzy-ros-gz
source /opt/ros/jazzy/setup.bash
cd /tmp/ws
rosdep install --from-paths src -iy
colcon build --mixin release

@Tacha-S
Copy link
Author

Tacha-S commented Oct 9, 2025

I had already included several packages in my workspace besides MTC, and after checking, I found that some of them conflict with each other.
That’s why I carefully investigated which packages were causing the issue and then provided the exact command to reproduce it.

So, I’d really appreciate it if you could follow the instructions exactly as written.
I specifically mentioned installing ros-jazzy-libcamera like this:

apt install ros-jazzy-ros-gz ros-jazzy-libcamera

This is because even installing just ros-jazzy-libcamera leads to a build error related to libyaml, which I confirmed myself.

@rhaschke
Copy link
Contributor

rhaschke commented Oct 9, 2025

Aah, libcamera is the actual culprit: it installs a conflicting, static version of libyaml -- in addition to the one pulled in via the rosdep dependency yaml = libyaml-dev:

dpkg -S /opt/ros/jazzy/lib/libyaml-0.a
ros-jazzy-libcamera: /opt/ros/jazzy/lib/libyaml-0.a

@christian-rauch: Can you comment on this redundancy?

@christian-rauch
Copy link
Member

Inspecting https://build.ros2.org/view/Jbin_uN64/job/Jbin_uN64__libcamera__ubuntu_noble_amd64__binary/16/consoleFull, I can see that the libyaml subproject is forced. So it is installing the subproject even with libyaml-dev installed.

According to https://github.com/ros2-gbp/libcamera-release/blob/9f4749621ab01bafa4dc036166407842d6cb2341/debian/rules#L31-L37, this forced fallback to the subprojects is only supposed to be applied to the subproject libpisp. I have to investigate why this also applies to libyaml.

@rhaschke
Copy link
Contributor

I merged your suggestions as 377d090, 35063ff, and 43cd03d.

@rhaschke rhaschke closed this Oct 10, 2025
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

Successfully merging this pull request may close these issues.

3 participants