Skip to content

build: PIC static archives, cap CI build at 4 compile jobs - #66

Merged
ajakhotia merged 12 commits into
mainfrom
ajakhotia/skip-gz-math-bindings
Aug 22, 2026
Merged

ajakhotia merged 12 commits into
mainfrom
ajakhotia/skip-gz-math-bindings

Conversation

@ajakhotia

@ajakhotia ajakhotia commented Aug 20, 2026 •

Copy link
Copy Markdown
Owner

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 ON and 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, with CARGO_BUILD_JOBS covering 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 terra target, and the installed static configs of gz-common/gz-plugin reference TINYXML2::TINYXML2 and DL::DL targets 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.

@ajakhotia
ajakhotia force-pushed the ajakhotia/skip-gz-math-bindings branch from 6d69d7a to ea51b79 Compare August 21, 2026 06:02
@ajakhotia ajakhotia changed the title build(gz, sdformat): skip the ruby and python bindings build: PIC static archives, cap CI build at 4 compile jobs Aug 21, 2026
@ajakhotia
ajakhotia force-pushed the ajakhotia/skip-gz-math-bindings branch 2 times, most recently from d788149 to 273df3f Compare August 21, 2026 06:11
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
ajakhotia force-pushed the ajakhotia/skip-gz-math-bindings branch from 273df3f to cea1069 Compare August 21, 2026 06:12
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.
@ajakhotia
ajakhotia merged commit 891bceb into main Aug 22, 2026
42 checks passed
@ajakhotia
ajakhotia deleted the ajakhotia/skip-gz-math-bindings branch August 22, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant