From d90d498cdbce8f3bc71053a8a9efb2d0ce324c2a Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Mon, 13 Jul 2026 19:13:29 +0200 Subject: [PATCH] docker: put the static libdbus on CMAKE_PREFIX_PATH for Qt6::DBus consumers The Qt build found dbus via -DDBus1_DIR, but a static Qt records the dependency and every consumer re-runs find_package(DBus1) through Qt's exported config (Qt6Gui -> Qt6DBus -> find_dependency(WrapDBus1)). Without the dbus prefix on the consumer's search path that fails: Could NOT find WrapDBus1 (missing: DBus1_LIBRARY DBus1_INCLUDE_DIR ...) Qt6DBus could not be found because dependency WrapDBus1 could not be found. Add /opt/dbus--static to the image's CMAKE_PREFIX_PATH env so the viewer build (and the CI .deb/.rpm and tarball builds) resolve it. Verified against the rocky9 image: find_package(Qt6 ... DBus) fails with the old path and passes with dbus on the env CMAKE_PREFIX_PATH. Also make build_in_rocky9.sh self-sufficient on images built before this fix: it discovers /opt/dbus-*-static/lib/cmake/DBus1 and passes -DDBus1_DIR, so the viewer verification works without rebuilding the image first. Co-Authored-By: Claude Opus 4.8 (1M context) --- docker/build_in_rocky9.sh | 5 +++++ docker/rocky8/Dockerfile | 6 ++++-- docker/rocky9/Dockerfile | 6 ++++-- docker/ubuntu2204/Dockerfile | 6 ++++-- docker/ubuntu2404/Dockerfile | 6 ++++-- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/docker/build_in_rocky9.sh b/docker/build_in_rocky9.sh index 921f285d..71aa71b0 100755 --- a/docker/build_in_rocky9.sh +++ b/docker/build_in_rocky9.sh @@ -28,8 +28,13 @@ docker run --rm \ "$IMG" bash -lc ' set -eux git config --global --add safe.directory /workspace || true + # If this image predates the CMAKE_PREFIX_PATH fix, point cmake at the static libdbus config + # dir so the viewer (Qt6::DBus -> find_package(DBus1)) resolves WrapDBus1. Harmless once the + # image ENV already carries it. + dbus_dir=$(ls -d /opt/dbus-*-static/lib/cmake/DBus1 2>/dev/null | head -1) cmake -G Ninja -S /workspace -B /tmp/build \ -DJFJOCH_VIEWER_ONLY=ON -DJFJOCH_USE_CUDA=ON \ + ${dbus_dir:+-DDBus1_DIR=$dbus_dir} \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_CXX_FLAGS="-march=x86-64-v3" -DCMAKE_C_FLAGS="-march=x86-64-v3" ninja -C /tmp/build -j"$(nproc)" jfjoch_viewer diff --git a/docker/rocky8/Dockerfile b/docker/rocky8/Dockerfile index 357d031f..f3db6b7f 100644 --- a/docker/rocky8/Dockerfile +++ b/docker/rocky8/Dockerfile @@ -168,8 +168,10 @@ RUN set -eux; \ cmake --install eigen-build; \ cd /; rm -rf /tmp/eigen /tmp/eigen-build -# Make Qt and Eigen discoverable by CMake -ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/eigen-3.4 +# Make Qt, the static libdbus, and Eigen discoverable by CMake. The static libdbus prefix is +# required here (not only at Qt build time): every Qt6::DBus consumer re-runs find_package(DBus1) +# through Qt's exported config, so DBus1Config.cmake must be on CMAKE_PREFIX_PATH for the viewer build. +ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/dbus-${DBUS_VERSION}-static:/opt/eigen-3.4 # Set workdir for your project WORKDIR /workspace diff --git a/docker/rocky9/Dockerfile b/docker/rocky9/Dockerfile index f5328bff..57a513f8 100644 --- a/docker/rocky9/Dockerfile +++ b/docker/rocky9/Dockerfile @@ -207,8 +207,10 @@ RUN set -eux; \ cmake --install eigen-build; \ cd /; rm -rf /tmp/eigen /tmp/eigen-build -# Make Qt and Eigen discoverable by CMake -ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/eigen-3.4 +# Make Qt, the static libdbus, and Eigen discoverable by CMake. The static libdbus prefix is +# required here (not only at Qt build time): every Qt6::DBus consumer re-runs find_package(DBus1) +# through Qt's exported config, so DBus1Config.cmake must be on CMAKE_PREFIX_PATH for the viewer build. +ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/dbus-${DBUS_VERSION}-static:/opt/eigen-3.4 ENV LANG=en_US.UTF-8 ENV LANGUAGE=en_US:en diff --git a/docker/ubuntu2204/Dockerfile b/docker/ubuntu2204/Dockerfile index 7fcadefd..56588301 100644 --- a/docker/ubuntu2204/Dockerfile +++ b/docker/ubuntu2204/Dockerfile @@ -196,8 +196,10 @@ RUN set -eux; \ cmake --install eigen-build; \ cd /; rm -rf /tmp/eigen /tmp/eigen-build -# Make Qt and Eigen discoverable by CMake -ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/eigen-3.4 +# Make Qt, the static libdbus, and Eigen discoverable by CMake. The static libdbus prefix is +# required here (not only at Qt build time): every Qt6::DBus consumer re-runs find_package(DBus1) +# through Qt's exported config, so DBus1Config.cmake must be on CMAKE_PREFIX_PATH for the viewer build. +ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/dbus-${DBUS_VERSION}-static:/opt/eigen-3.4 # Set workdir for your project WORKDIR /workspace diff --git a/docker/ubuntu2404/Dockerfile b/docker/ubuntu2404/Dockerfile index f0b649e7..ca9678c7 100644 --- a/docker/ubuntu2404/Dockerfile +++ b/docker/ubuntu2404/Dockerfile @@ -183,8 +183,10 @@ RUN set -eux; \ cmake --install eigen-build; \ cd /; rm -rf /tmp/eigen /tmp/eigen-build -# Make Qt and Eigen discoverable by CMake -ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/eigen-3.4 +# Make Qt, the static libdbus, and Eigen discoverable by CMake. The static libdbus prefix is +# required here (not only at Qt build time): every Qt6::DBus consumer re-runs find_package(DBus1) +# through Qt's exported config, so DBus1Config.cmake must be on CMAKE_PREFIX_PATH for the viewer build. +ENV CMAKE_PREFIX_PATH=/opt/qt-${QT_VERSION}-static:/opt/dbus-${DBUS_VERSION}-static:/opt/eigen-3.4 # Set workdir for your project WORKDIR /workspace