ci(cpp): cross-compile matrix + static binary packaging for C++ agents (#1094)#1406
Conversation
#1094) C++ agents had no cross-platform binary distribution path: the existing build_cpp.yml only compiled and tested the library, leaving the example agents (health, wifi, process, vlm, security-demo) with no shippable, self-contained artifact. This adds the packaging half of Agent Hub Phase 2B. build_agents.yml builds each agent with static linking (BUILD_SHARED_LIBS=OFF, vcpkg *-static triplets, static MSVC runtime) across win-x64 (MSVC), linux-x64 (GCC), and darwin-arm64 (Clang), so the binaries carry no runtime DLL/.so dependency. package_agents.py then emits dist/<id>/ with the renamed binary, its gaia-agent.yaml, and checksums.sha256; on a v* tag a release job consolidates every platform into one bundle for downstream publishing (R2/PyPI live in other issues). Isolated from the #1102 Python restructure — touches only cpp/ and CI.
SummaryClean, well-scoped packaging PR — it gives the The one thing worth addressing: Issues Found🟡 ImportantNo unit tests for 🟢 Minor
vcpkg cache key tracks the wrong file ( Strengths
VerdictApprove with suggestions. No blocking or security issues; the build/packaging wiring is consistent with the manifest schema and CMake targets. I'd like to see |
The runners' vcpkg has no built-in x64-linux-static or arm64-osx-static triplet (only Windows ships *-static variants), so the Linux and macOS Package legs failed at the vcpkg install step with 'Invalid triplet'. Provide them as overlay triplets in cpp/triplets/ and pass --overlay-triplets / VCPKG_OVERLAY_TRIPLETS so the names resolve on every platform. Windows keeps using its built-in x64-windows-static (already green).
|
🟡 The (or bump both to v8 — whichever versions actually exist on the runners.) |
CI status after the overlay-triplet fixAll three Package legs are green on the latest run, and artifacts upload on every platform:
Root cause of the earlier linux/macOS failures: the runners' vcpkg has no built-in On |
Why this matters
Before: the C++ agents in
cpp/(health, wifi, process, vlm, security-demo) had no distribution path —build_cpp.ymlonly compiled and tested the library, so there was no self-contained binary anyone could download and run, and nodist/artifact for the Agent Hub to publish. After: every agent is built as a static, cross-platform binary (no runtime DLL/.sodependency) and packaged with itsgaia-agent.yaml+ checksum, on Windows, Linux, and macOS. This is the packaging half of Agent Hub Phase 2B (issue #1094).build_agents.ymladds the cross-compile matrix — win-x64 (MSVC), linux-x64 (GCC), darwin-arm64 (Clang) — building withBUILD_SHARED_LIBS=OFF, vcpkg*-statictriplets, and the static MSVC runtime.cpp/packaging/package_agents.pythen emitsdist/<id>/with the renamed binary, the agent's manifest, andchecksums.sha256. On av*tag a release job consolidates all platforms into one bundle; actual R2/PyPI publishing is handled by other Agent Hub issues.Windows-only agents (health/wifi/process) build on the win-x64 leg only; security-demo and vlm are portable and prove the Linux/macOS legs. Manifests validate against the
gaia-agent.yamlparser from #1091.Isolated from the #1102 Python restructure — touches only
.github/workflows/,cpp/, and a packaging script. Nosrc/gaia/changes.Spec:
docs/spec/agent-hub-restructure.mdx(Step 9 — CI/CD;cpp.binaries/static_linked).Test plan
python -c "import yaml; yaml.safe_load(open('.github/workflows/build_agents.yml'))"— workflow is valid YAMLcpp/agents/*/gaia-agent.yamlparse viagaia.hub.manifest.parse(cpp, static_linked, correct platforms)package_agents.pysmoke-tested with synthetic build trees for win-x64 (5 agents) and linux-x64 (2 agents): correctdist/<id>/layout, stale Debug copies skipped, checksums written, fails loudly on missing binarypython util/lint.py --black --isortpasses