Baf 1717/cmake migration - #10
Conversation
Replace cmlib dependency resolution with plain CMake + FetchContent, following the pattern already validated for external-server-cpp (BAF-1706) and mission-module (BAF-1715). 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: 58 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 (18)
✨ 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 10 dependency pins are preserved on the FetchContent branch, and the removed BRINGAUTO_* options cause no demonstrable build break. Nice clean migration. Three non-blocking findings:
1. MEDIUM — version floor is dropped on the system/config fast-path
The system/config fast-paths in the FindBA* shims call find_package(... QUIET CONFIG) without a version constraint, and cmake/Findfleet-protocol-interface.cmake sets _FOUND TRUE but never sets _VERSION. As a result FIND_PACKAGE(fleet-protocol-interface 2.1.0 REQUIRED) performs no version check when a system/config package is present — a stale/mismatched package is silently accepted. Same weakening in FindBAAeron, FindBAAsyncFunctionExecution, FindBAFleetProtocolCpp, FindBACppRestSdk, FindBAFleetHttpClient (FindBANlohmannJson correctly keeps its floor).
Fix: pass the pinned version into the config-mode find_package calls and have the forwarding shims propagate <pkg>_VERSION so the top-level FIND_PACKAGE(... <ver> REQUIRED) actually validates.
2. MEDIUM — unrestored BUILD_SHARED_LIBS ... CACHE ... FORCE global mutation
FindBAAsyncFunctionExecution.cmake and FindBACppRestSdk.cmake do set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) and never restore it, so it leaks into every dependency fetched afterward. Inconsistent with FindBABoost.cmake, which uses a plain non-cache set(BUILD_SHARED_LIBS OFF).
Fix: prefer the non-cache form, or save/restore the previous value around FetchContent_MakeAvailable. Avoid FORCE on a global toggle.
3. LOW — CMDEF_COMPILE_DEFINITIONS shim ignores its scope argument
The shim (cmake/FindCMLIB.cmake) accepts a scope arg (ALL/PUBLIC/PRIVATE) but discards it and calls directory-global add_compile_definitions(), leaking definitions project-wide rather than to the intended target.
Fix: forward to target_compile_definitions(<target> <scope> ...), or document that the shim is intentionally directory-wide.
🤖 Review generated with Claude Code
Summary
Migrates transparent-module (v1.0.5) 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 —transparent_module-1.0.5-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-1717-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).Note: this module was previously missing from fleet-os-deploy's
deployment.json entirely — added an entry for it (module-num 3) as part of
today's verification so it could be exercised through the pipeline at all.
Closes BAF-1717.