Fix Rolling build: fmt::runtime, Qt5/Qt6 dual-support, rviz Display::update, char8_t - #754
Open
nbbrooks wants to merge 4 commits into
Open
Fix Rolling build: fmt::runtime, Qt5/Qt6 dual-support, rviz Display::update, char8_t#754nbbrooks wants to merge 4 commits into
nbbrooks wants to merge 4 commits into
Conversation
On ROS Rolling (fmt >= 10) format strings must be consteval. cost_terms.cpp builds format strings by concatenating PREFIX at runtime; stage.cpp uses a generic auto... args lambda that fmt::format then can't verify at compile time. Wrap both call sites with fmt::runtime() to tell fmt these are real runtime format strings. No behavior change on humble/jazzy/kilted where fmt was more permissive.
Try Qt6 first, fall back to Qt5. Ubuntu Resolute removes Qt5 from the default apt indexes; humble/jazzy/kilted still have Qt5. Additive-only. qt_wrap_ui macro gets a conditional qt5/qt6 branch.
- task_list_model.cpp, remote_task_model.cpp: reinterpret_cast<const char*>
around u8"..." literals so they can feed Qt tr() under C++20's char8_t
distinction.
- task_display.{h,cpp}: dual-signature update() override guarded on
RCLCPP_VERSION_GTE(30, 0, 0). Rolling switched Display::update from
(float, float) to (std::chrono::nanoseconds, std::chrono::nanoseconds);
Rolling branch converts to float seconds and calls the existing body.
… rosdep key
Two corrections to the Qt5/Qt6 dual-support commit.
1. Gate on rviz_common_VERSION, not Qt6 availability
find_package(Qt6 QUIET) succeeds whenever Qt6 is merely installed, which
says nothing about which Qt rviz was built against -- and this package links
rviz_common/rviz_default_plugins, so its Qt must match rviz's. Ubuntu 24.04
ships both, so on jazzy or kilted with qt6-base-dev present the probe does
not silently mis-select; it aborts the configure, because rviz_common has
already defined the versionless Qt::Core target:
CMake Error at Qt6CoreVersionlessTargets.cmake:42:
Some (but not all) targets in this export set were already defined.
QUIET does not suppress that -- it is a FATAL_ERROR inside Qt6's own config,
not a not-found condition, so the Qt5 fallback is never reached.
rviz switched to Qt6 in 15.1.14: ros2/rviz#1635 (merged 2025-12-08) first
shipped in that tag on 2025-12-17. Note 15.1.0 through 15.1.13 are still
Qt5, so the threshold is 15.1.14 rather than 15.1.
humble rviz 11.2 -> Qt5 lyrical rviz 15.2 -> Qt6
jazzy rviz 14.1 -> Qt5 rolling rviz 16.0 -> Qt6
kilted rviz 15.0 -> Qt5
rviz_common is already find_package'd above the Qt block, so the version is
in scope. Also carries the QT_DIR hint for transitive deps whose
find_package(QT NAMES Qt6 Qt5 ...) can mis-resolve under CMake's ascending
path order.
2. package.xml still requested Qt5 unconditionally
<build_depend>qtbase5-dev</build_depend>
That resolves to Qt5 on every platform, so rosdep would install Qt5 while
CMake selects Qt6 -- which is exactly how the collision above arises. The
versionless key maps per-platform, the same move ros2/rviz#1635 made in
rviz_common's own package.xml:
key jammy noble * (resolute)
qt-base-dev qtbase5-dev qtbase5-dev qt6-base-dev
That agrees with the CMake gate on every distro this branch ships to.
Same pair of fixes as PickNikRobotics/rviz_visual_tools#300.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Four Rolling/Resolute incompatibilities, all found by an end-to-end source build in an
ubuntu:resolutecontainer.consteval. Runtime-composed format strings incore/src/cost_terms.cppandcore/src/stage.cppno longer compile.find_package(Qt5 REQUIRED)collides with a Qt6 rviz.Display::updatesignature changed from(float, float)to(std::chrono::nanoseconds, std::chrono::nanoseconds)atRCLCPP_VERSION_GTE(30, 0, 0).TaskDisplay's override no longer matches, so the class stops being a concreteDisplay— the plugin fails to load and won't build with-Werror.char8_t.u8"…"literals needreinterpret_cast<const char*>to feed Qttr().How
fmt::runtime().qt5_wrap_ui/qt6_wrap_uiswitched to match. Gated onrviz_common_VERSIONrather than Qt6 availability — see below.Display::update: dual-signature guarded onRCLCPP_VERSION_GTE(30, 0, 0); the Rolling branch takes nanoseconds, converts, and calls the existing implementation. humble/jazzy/kilted keep the old override.char8_t:reinterpret_cast<const char*>at each affectedtr()call.Why the Qt gate is on rviz's version, not Qt6 availability
find_package(Qt6 QUIET)succeeds whenever Qt6 is merely installed, which says nothing about which Qt rviz was built against — and this package linksrviz_common/rviz_default_plugins, so its Qt must match. Ubuntu 24.04 ships both, so on jazzy or kilted withqt6-base-devpresent the probe doesn't quietly mis-select — it aborts the configure, becauserviz_commonhas already defined the versionlessQt::Coretarget:QUIETdoesn't suppress that — it's aFATAL_ERRORinside Qt6's own config, not a not-found condition, so the Qt5 fallback is never reached.The threshold is 15.1.14, not 15.1: ros2/rviz#1635 merged 2025-12-08 but first shipped in the 15.1.14 tag on 2025-12-17 — 15.1.0 through 15.1.13 are still Qt5.
package.xmlalso needed fixingvisualization/package.xmlrequestedqtbase5-devunconditionally, which resolves to Qt5 on every platform — so rosdep would install Qt5 while CMake selects Qt6, which is precisely how the collision above arises. Switched to the versionlessqt-base-dev, which rosdep maps per-platform (jammy/noble→qtbase5-dev,*→qt6-base-dev) — the same move ros2/rviz#1635 made inrviz_common's ownpackage.xml.Both fixes mirror PickNikRobotics/rviz_visual_tools#300, merged and green on all five distros.
Verification
Verified by an end-to-end source build of
moveit_task_constructor(core + capabilities + visualization + demo) inubuntu:resoluteagainst a Rolling workspace. Every guarded branch preserves existing behavior on humble/jazzy/kilted.Note the two Resolute CI jobs will fail on
ros-{lyrical,rolling}-moveit-corenot existing —moveit_coreis not yet published for Resolute, which blocks every downstream package there. Unrelated to this change; those jobs are non-blocking.🤖 Generated with Claude Code