Skip to content

Commit 383319f

Browse files
Copilotubruhin
andauthored
Ubuntu 26.04: Fix OCCT dependencies to avoid VTK/Java/GCC-16 bloat
The libocct-*-dev packages in Ubuntu 26.04 have a hard dependency on libocct-ivtk-dev, which pulls in the full VTK stack, Java (OpenJDK 25), MPI, the GCC-16 compiler suite, Boost dev, GDAL, HDF5, media codecs, and ~2GB of other transitive bloat. To work around this Ubuntu 26.04 packaging issue: 1. Install the OCCT runtime packages (libocct-*-7.9) via apt normally - they have no VTK dependency. 2. Extract the dev package files (headers, cmake configs, .so symlinks) using dpkg-deb -x, bypassing apt dependency resolution entirely. 3. Also extract libocct-ivtk-7.9 (the 112K runtime .so) so that cmake's OpenCASCADEVisualizationTargets.cmake can find libTKIVtk.so.7.9. 4. Remove cargo registry/git cache after cargo install to save space. Verified: cmake find_package(OpenCASCADE) succeeds and a test program using BRep/STEP headers compiles successfully, with no VTK or Java installed in the image. Agent-Logs-Url: https://github.com/LibrePCB/docker-librepcb-dev/sessions/13556661-f78f-4ed6-8f93-71071bd01171 Co-authored-by: ubruhin <5374821+ubruhin@users.noreply.github.com>
1 parent 98f9ed3 commit 383319f

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

ubuntu-26.04/Dockerfile

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,18 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
2727
libgtest-dev \
2828
libmuparser-dev \
2929
libmuparser2v5 \
30-
libocct-*-dev \
30+
# The libocct-*-dev packages have an unnecessary hard dependency on
31+
# libocct-ivtk-dev, which pulls in VTK, Java, MPI, the GCC-16 compiler
32+
# suite, and ~2GB of other bloat. To work around this Ubuntu 26.04
33+
# packaging issue, we install the OCCT runtime packages here via apt
34+
# and extract the dev package files (headers, cmake configs, .so symlinks)
35+
# separately below using dpkg-deb, bypassing the broken dependency.
36+
libocct-data-exchange-7.9 \
37+
libocct-foundation-7.9 \
38+
libocct-modeling-algorithms-7.9 \
39+
libocct-modeling-data-7.9 \
40+
libocct-ocaf-7.9 \
41+
libocct-visualization-7.9 \
3142
libpolyclipping-dev \
3243
libpolyclipping22 \
3344
libqt6opengl6-dev \
@@ -52,6 +63,22 @@ RUN apt-get update -q && apt-get -y -q install --no-install-recommends \
5263
xvfb \
5364
zlib1g \
5465
zlib1g-dev \
66+
# Extract OCCT dev package files (headers, cmake configs, .so symlinks) without
67+
# going through apt install (which would pull in the unwanted ivtk dependency).
68+
# Also extract libocct-ivtk-7.9 (112K .so) so cmake's
69+
# OpenCASCADEVisualizationTargets.cmake can find libTKIVtk.so.7.9.
70+
&& cd /tmp \
71+
&& apt-get download \
72+
libocct-data-exchange-dev \
73+
libocct-draw-dev \
74+
libocct-foundation-dev \
75+
libocct-modeling-algorithms-dev \
76+
libocct-modeling-data-dev \
77+
libocct-ocaf-dev \
78+
libocct-visualization-dev \
79+
libocct-ivtk-7.9 \
80+
&& for f in /tmp/libocct-*.deb; do dpkg-deb -x "$f" /; done \
81+
&& rm -f /tmp/libocct-*.deb \
5582
&& rm -rf /var/lib/apt/lists/*
5683

5784
# Install Rust
@@ -63,6 +90,7 @@ ENV RUSTUP_HOME="/.rustup" \
6390
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
6491
| sh -s -- -y --default-toolchain $RUST_VERSION --profile minimal --no-modify-path \
6592
&& cargo install cargo-llvm-cov \
93+
&& rm -rf $CARGO_HOME/registry $CARGO_HOME/git \
6694
&& chmod -R 777 $RUSTUP_HOME \
6795
&& chmod -R 777 $CARGO_HOME
6896

0 commit comments

Comments
 (0)