diff --git a/scripts/Dockerfile.deps b/scripts/Dockerfile.deps index a73993fb64..d5d89773fd 100644 --- a/scripts/Dockerfile.deps +++ b/scripts/Dockerfile.deps @@ -67,4 +67,14 @@ RUN ./build_linux.sh -u # Pinned dependencies in ./deps (OCCT 7.6 with ModelingAlgorithms enabled, OpenCV, # OpenVDB, Boost, wxWidgets, ...). This is the long step; it is baked into the image. -RUN ./build_linux.sh -dr +# -j 12, not the default all-cores: on 2026-08-21 an unbounded deps build plus an unbounded +# app build put 42 GB of cc1plus on a 62 GB box and OOM-killed the host for 2h28m. 12 keeps +# the compile fast while leaving the machine usable. Pair with `docker build --memory`. +RUN ./build_linux.sh -dr -j 12 + +# Compatibility symlink. This deps tree installs into deps/build/OrcaSlicer_dep/, while the +# orcacad_buildcache volume was configured against the previous image, whose prefix was +# deps/build/destdir/. Those paths are baked as absolute strings into the app's CMakeCache, so +# without this symlink a rebuild on the new image reconfigures from scratch — hours of compile +# to change one directory name. Same tree, two names. +RUN ln -sfn /OrcaSlicer/deps/build/OrcaSlicer_dep /OrcaSlicer/deps/build/destdir diff --git a/scripts/rig-build.sh b/scripts/rig-build.sh index e749fff298..72e9fc3ace 100755 --- a/scripts/rig-build.sh +++ b/scripts/rig-build.sh @@ -42,13 +42,13 @@ fi # build produced a single object. The bounds, weakest to strongest: # flock — the lock path is shared by both forks on purpose, so they SERIALISE instead of # summing. Peak is one build's worth no matter who else starts one. -# -j8 — ~8 TUs in flight, ~10-20 GB, and the box stays usable while it compiles. -# JOBS=n overrides for a machine with more headroom. +# -j12 — measured 1.17 GB average per cc1plus in the incident dump, so 12 in flight +# is ~14 GB typical and leaves the box usable. JOBS=n overrides. # --memory — the actual guarantee. A runaway build hits its own cgroup limit and dies alone; # the host never reaches global OOM again, whatever -j or flock do. # --memory-swap equal to --memory forbids swap, which is what made ssh hang. -JOBS="${JOBS:-8}" -MEM="${MEM:-32g}" +JOBS="${JOBS:-12}" +MEM="${MEM:-40g}" LOCK=/tmp/orca-rig-build.lock exec 9>"$LOCK"