Baf 1715/cmake migration - #32
Conversation
Replace cmlib dependency resolution with plain CMake + FetchContent, following the pattern already validated for external-server-cpp (BAF-1706). FLEET_PROTOCOL_BUILD_MODULE_GATEWAY / FLEET_PROTOCOL_BUILD_EXTERNAL_SERVER and all gateway/server build logic are untouched; no source files changed. Validated end-to-end in bringauto/cpp-build-environment for all three flag combinations (gateway-only, external-server-only, both). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- CMakeLists.txt dropped FIND_PACKAGE(CMLIB ...) during the FetchContent migration, so cmake/FindCMLIB.cmake was never loaded and CMDEF_ADD_LIBRARY/ CMDEF_INSTALL were undefined -> configure failed immediately. - CMDEF_PACKAGE shim was a no-op and silently dropped VERSION, so cpack always produced 0.1.1 instead of the real module version.
|
Warning Review limit reached
Next review available in: 59 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (19)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
jiriskuta
left a comment
There was a problem hiding this comment.
Review — CMake migration (cmlib → plain CMake + FetchContent)
Version-pin audit: all dependency pins are preserved (fleet-protocol-interface v2.1.0, fleet-protocol-cpp v1.2.0, async-function-execution v1.0.0, aeron 1.48.6, zlib v1.3.2, nlohmann-json fetch v3.12.0, fleet-http-client v2.0.2, boost 1.86.0, cpprestsdk v2.10.20). protobuf v3.21.12 is a newly-explicit dep, not a regression. Looks good with minor changes.
1. MEDIUM — hardcoded personal machine paths + stale task notes committed to CLAUDE.md
The new ## CURRENT TASK block hardcodes /home/martin/Code/kubernetes/... in four places (reference shims, debug-loop cd, follow-up paths). It also commits a transient per-task worklog into a permanent doc, and that table is already factually stale vs the shipped code: it lists fleet-protocol-cxx-helpers-static 1.1.1 and nlohmann_json 3.10.5, but the actual pins are v1.2.0 and fetch v3.12.0.
Fix: remove the task block from CLAUDE.md (keep it in the PR description / tracker). If build docs are wanted, add repo-relative, version-accurate instructions.
2. LOW/MEDIUM — FindBAZlib.cmake depends on another module having forced BUILD_SHARED_LIBS OFF
FindBAZlib.cmake aliases zlibstatic and its comment assumes BUILD_SHARED_LIBS is forced OFF, but this module never sets it — it relies on FindBAAsyncFunctionExecution.cmake (runs earlier, set(... CACHE BOOL "" FORCE)) having done so. Reordering Dependencies.cmake, or making the async fetch conditional, would silently flip zlib to a shared build and break the alias.
Fix: have FindBAZlib.cmake set BUILD_SHARED_LIBS OFF itself before its FetchContent_MakeAvailable, or branch on whichever of zlib/zlibstatic actually exists.
3. LOW — removed BRINGAUTO_SYSTEM_DEP / BRINGAUTO_GET_PACKAGES_ONLY makes resolution unconditional
SYSTEM_DEP=ON (skip Dependencies.cmake) is subsumed gracefully by system-first resolution — no regression. But GET_PACKAGES_ONLY=ON (early RETURN(), packager-only) is gone; any CI/deploy invocation still passing these flags now silently proceeds to a full build (CMake only warns "unused variable").
Fix: confirm no CI/deploy step still passes -DBRINGAUTO_SYSTEM_DEP=ON / -DBRINGAUTO_GET_PACKAGES_ONLY=ON; note the removal in the PR/changelog.
4. LOW — FindBAAeron.cmake include-dir wiring lacks a TARGET guard
target_include_directories(aeron_driver ...) / aeron_driver_static are called unconditionally, while the install loop just below guards each with if(TARGET ...). If upstream aeron omits either target under some options, configure hard-errors.
Fix: wrap each in if(TARGET ...).
🤖 Review generated with Claude Code



Summary
Migrates mission-module (v2.0.0) off cmlib onto plain CMake + FetchContent,
following the same pattern established in external-server-cpp (BAF-1706).
FIND_PACKAGE(CMLIB ...)/CMDEF_ADD_LIBRARY/CMDEF_INSTALLusage with a
cmake/FindCMLIB.cmakecompatibility shim, so the rest ofCMakeLists.txt is unchanged.
FindBA*.cmakemodules that resolve each dependency via a system/config package first, falling back to FetchContent (nlohmann_json,
fleet-protocol-interface, fleet-protocol-cxx-helpers-static,
async-function-execution-shared, aeron, fleet-http-client-shared, Boost,
ZLIB, cpprestsdk).
Fixes on top of the original migration commit
Found while verifying the migration builds:
FIND_PACKAGE(CMLIB COMPONENTS CMDEF CMUTIL STORAGE REQUIRED)fromCMakeLists.txt, so
cmake/FindCMLIB.cmake(which definesCMDEF_ADD_LIBRARY/CMDEF_INSTALL) was never loaded. Restored the call.CMDEF_PACKAGEshim was a no-op andsilently dropped its
VERSIONargument, socpackalways produced0.1.1instead of the real module version. Shim now setsCPACK_PACKAGE_VERSIONfrom the passed version.Verification
-DFLEET_PROTOCOL_BUILD_EXTERNAL_SERVER=OFF): configure, build, andcpackall pass —MissionModule-2.0.0-Linux.zip.-DBRINGAUTO_PACKAGE=ON, matching what the real deploy pipeline runs):passes.
fleet-os-deploypipeline end to end against a temp tag onthis branch (
temp/baf-1715-deploy-verify) — steps 1-7 and the aarch64dependency-sysroot assembly all pass. The run is currently blocked only
by the
fleet-os-3cross-compile Docker image not being available in anyreachable registry — an infra gap unrelated to this change (it fails
before even reaching this module, on
module-gateway).Closes BAF-1715.