build: PIC static archives, cap CI build at 4 compile jobs - #66
Merged
Merged
Conversation
ajakhotia
force-pushed
the
ajakhotia/skip-gz-math-bindings
branch
from
August 21, 2026 06:02
6d69d7a to
ea51b79
Compare
ajakhotia
force-pushed
the
ajakhotia/skip-gz-math-bindings
branch
2 times, most recently
from
August 21, 2026 06:11
d788149 to
273df3f
Compare
The gz and sdformat python/ruby binding modules are shared objects even in static builds, and they fail to link against non-PIC static archives (seen first at gz-math's ruby module on the clang-static job). Impose CMAKE_POSITION_INDEPENDENT_CODE from the root and forward it to every external project, so the bindings stay enabled in every flavor.
The superbuild's outer ninja fanned out external projects while each inner build used every core, oversubscribing the shared build machine into OOM kills that took the runner service down. Serialize the outer level and cap the inner builds at 4 jobs via CMAKE_BUILD_PARALLEL_LEVEL, with CARGO_BUILD_JOBS covering the zenoh cargo build.
ajakhotia
force-pushed
the
ajakhotia/skip-gz-math-bindings
branch
from
August 21, 2026 06:12
273df3f to
cea1069
Compare
CMake reads CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER from the environment at first configure, and the environment is inherited by every child configure inside the container, so the launchers sit with the other ccache settings on docker run instead of riding the forwarded cache entries.
VTK's Qt GUI support needs Qt6's OpenGL component, which qt6-base-dev provides on the newer bases but jammy splits into libqt6opengl6-dev.
…ally gz-rendering fails to export its vendored terra target in static builds, and the installed static configs of gz-common and gz-plugin reference TINYXML2::TINYXML2 and DL::DL targets that consumers cannot resolve. Skip those consumers in static builds only; the base gz libraries, gz-transport, and sdformat remain, and shared builds keep everything.
OpenCV builds CUDA through its legacy FindCUDA path, which probes nvcc itself and never sees the toolchain's CMAKE_CUDA_* settings. The fresh bases carry host compilers newer than nvcc admits (clang 22 on ubuntu 26.04), so the architecture autodetection came back empty and the configure failed. Hand OpenCV the architecture list matching the toolchain files and the -allow-unsupported-compiler override they already use.
cudss-config.cmake promotes its imported targets to global scope unconditionally, which CMake rejects when a second directory includes the config: opencv_contrib's sfm module re-finds Ceres, whose config finds cuDSS again, and the OpenCV configure dies. Patch an early return into the installed config so only the first inclusion creates and promotes.
CMake expands semicolons in COMMAND arguments as list separators, so the guard comment's semicolon split the sed text into a second file argument and the patch step failed.
With the static CUDA runtime OpenCV lists bare library names (cudart_static, cublas, cudnn) plus -L flags, and the python binding generator hands those names to ninja as file dependencies, failing the cv2 module link. The shared-runtime path resolves the CUDA libraries to full paths, as the passing shared lanes already show, and the CUDA libraries are system-provided at runtime either way.
In a static build the cv2 python module links every module directly, and OpenCV's legacy CUDA path emits bare linker names (cublas, cudnn) that the binding generator hands to ninja as file dependencies, so the module cannot link. The shared-runtime switch from the previous commit did not change that and is reverted. Python consumers use the shared flavors, where the bindings stay enabled.
VTK's QtQuick GUI support needs the Qt6 Quick and Qml configs from qt6-declarative-dev. The newer bases received it incidentally through the gz-gui group, which 22.04 never installs because gz is not buildable there, so its VTK configure failed. Declare the dependency in the VTK group itself on all bases.
opencv_contrib's cvv module requires the Qt6 Core5Compat component, which the newer bases received incidentally through the gz-gui group and 22.04 lacks entirely. Declare it in the OpenCV group on all bases, under jammy's package name libqt6core5compat6-dev there.
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.
Fixes to get main's matrix green while keeping features maximally enabled:
PIC everywhere. The gz/sdformat python and ruby binding modules are shared objects even in static builds, and they failed to link against the non-PIC static archives (first seen at gz-math's ruby module on the clang-static job). The root CMakeLists now imposes
CMAKE_POSITION_INDEPENDENT_CODE ONand forwards it to every external project, so all bindings stay enabled in every flavor. Verified: gz-math and its bindings now build clean in the static lanes.4-core cap in CI. The outer superbuild ninja fanned out external projects while each inner build used every core, oversubscribing the build machine into OOM kills that took the runner service down (exit 137 in the gnu-static log, oom-kill in the runner's journal). The outer level is now serialized and the inner builds capped at 4 jobs via
CMAKE_BUILD_PARALLEL_LEVEL, withCARGO_BUILD_JOBScovering zenoh's cargo build. The ccache launchers moved onto the container environment alongside.VTK on 22.04. VTK's Qt GUI support needs Qt6's OpenGL component, which qt6-base-dev provides on the newer bases but jammy splits into
libqt6opengl6-dev; added to the VTK group's 22.04 entry.Static gz stack. Upstream gz does not support static consumption: gz-rendering fails to export its vendored
terratarget, and the installed static configs of gz-common/gz-plugin referenceTINYXML2::TINYXML2andDL::DLtargets consumers cannot resolve. Static builds now skip the consumers of those configs (rendering, sensors, gui, sim, launch, physics, fuel-tools); the base gz libraries, gz-transport, and sdformat build statically, and shared builds keep the full stack.