bazel/Dockerfile: add X11/xcb runtime libs for --//:platform=gui#10844
Merged
maliberty merged 1 commit intoJul 8, 2026
Conversation
The Qt GUI openroad binary (built with --//:platform=gui) links against qt-bazel prebuilts, which stub X11 at link time but resolve libX11/libxcb/ libxkbcommon from the system at load time. The slim bazel-ci image ships no X11 runtime, so every bazel test run against the gui binary dies immediately at ld.so with: openroad: error while loading shared libraries: libX11-xcb.so.1: cannot open shared object file: No such file or directory Install the runtime (non -dev) subset of etc/DependencyInstaller.sh's GUI xcb package list. This exactly covers the gui openroad binary's direct NEEDED entries (verified via readelf/ldd); the tcl test suite runs in CLI mode and needs no X server or QT_QPA_PLATFORM. This unblocks jenkins-ci#155, which switches `bazelisk test` to the gui binary to populate the gui cache. Signed-off-by: SombraSoft <sombrio@sombrasoft.dev>
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds runtime X11/xcb libraries to the Bazel Dockerfile to support Qt GUI builds. The reviewer suggested combining these new packages into the existing RUN block to follow Dockerfile best practices, which avoids redundant layers and reduces the overall image size.
Comment on lines
34
to
+65
| time | ||
|
|
||
| # Runtime X11/xcb libraries for the Qt GUI build (--//:platform=gui). | ||
| # Qt itself is hermetic (qt-bazel prebuilts), but the linked openroad binary | ||
| # still resolves libX11/libxcb/libxkbcommon from the system at load time, so | ||
| # without these every test against the gui binary dies at ld.so with | ||
| # "libX11-xcb.so.1: cannot open shared object file". This is the runtime | ||
| # (non -dev) subset of etc/DependencyInstaller.sh's GUI xcb list. | ||
| RUN apt-get -y update \ | ||
| && apt-get -y install --no-install-recommends \ | ||
| libx11-6 \ | ||
| libx11-xcb1 \ | ||
| libsm6 \ | ||
| libice6 \ | ||
| libxcb1 \ | ||
| libxcb-cursor0 \ | ||
| libxcb-icccm4 \ | ||
| libxcb-image0 \ | ||
| libxcb-keysyms1 \ | ||
| libxcb-randr0 \ | ||
| libxcb-render0 \ | ||
| libxcb-render-util0 \ | ||
| libxcb-shape0 \ | ||
| libxcb-shm0 \ | ||
| libxcb-sync1 \ | ||
| libxcb-util1 \ | ||
| libxcb-xfixes0 \ | ||
| libxcb-xkb1 \ | ||
| libdbus-1-3 \ | ||
| libfontconfig1 \ | ||
| libxkbcommon0 \ | ||
| libxkbcommon-x11-0 |
Contributor
There was a problem hiding this comment.
To adhere to Dockerfile best practices, please combine these new packages into the existing RUN block above. This avoids a redundant apt-get update layer, reduces the overall image size, and prevents potential cache-busting issues.
You can move the explanatory comment above the main RUN block (around line 20) to keep the documentation intact.
time \
libx11-6 \
libx11-xcb1 \
libsm6 \
libice6 \
libxcb1 \
libxcb-cursor0 \
libxcb-icccm4 \
libxcb-image0 \
libxcb-keysyms1 \
libxcb-randr0 \
libxcb-render0 \
libxcb-render-util0 \
libxcb-shape0 \
libxcb-shm0 \
libxcb-sync1 \
libxcb-util1 \
libxcb-xfixes0 \
libxcb-xkb1 \
libdbus-1-3 \
libfontconfig1 \
libxkbcommon0 \
libxkbcommon-x11-0
maliberty
approved these changes
Jul 8, 2026
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.
Problem
jenkins-ci#155 switches
bazelisk testto--//:platform=guito populate the gui remote cache. That reds the Bazel Tests stage: the guiopenroadbinary links against theqt-bazelprebuilts, which stub X11 at link time but resolvelibX11/libxcb/libxkbcommonfrom the system at runtime (see the comment inMODULE.bazel). The slimbazel-ciimage (FROM ubuntu:24.04) ships no X11 runtime, so every test dies atld.so:All tests fail in ~0.1s (loader-level, before
main), which is why the stage failed even though the compile/cache-warm succeeded.Fix
Install the runtime (non-
-dev) subset ofetc/DependencyInstaller.sh's GUI xcb list intobazel/Dockerfile. These 22 packages exactly cover the guiopenroadbinary's directNEEDEDentries.Validation
bazelisk build --//:platform=gui //:openroadsucceeds locally.readelf -d/lddon the resulting binary → 22 X11/xcb/dbus/fontconfig/xkbcommonNEEDEDlibs; each is a hard load-time dep, so the set is minimal.bazel/Dockerfileand ran the gui binary inside it as uid 9000: all libs resolve,openroad -versionand a CLI tcl script both run (EXIT=0,Features: ... +GUI).QT_QPA_PLATFORM=offscreenneeded — the tcl suite runs in CLI mode and never constructs a QApplication.Qt is not installed here on purpose — it's hermetic via
qt-bazel. Only the system X11 runtime is missing. Matt confirmed there are no GUI tests beyond man-page generation, so this is purely making the existing tests run against the gui binary.