4.3 KiB
14 — CMake-facing dependency integration
Implementation status: IMPLEMENTED & VERIFIED (2026-11-26). See STATE and VERIFICATION for implemented files and observed checks.
Requirements and ownership
- Requirements: R-009, R-010, R-018.
- Delivery phase: Package-manager adoption.
- Intended configured role: sol_implementer at XHigh; fresh astra_reviewer acceptance.
- Dependencies: 11/12 native package resolution; 13 imported interfaces; 15 package exports.
- Proposed exclusive implementation scope: cmake/bridge/, src/package/export-cmake/, tests/cmake-bridge/; root owns bridge/CLI protocol compatibility.
Before dispatch, reconcile these paths with the real HEAD, write a full task spec, lint it, and transfer shared-file ownership explicitly. Paths that do not yet exist are NEW. Source-disjoint work still coordinates shared state, ports and build directories.
Design and interfaces
- Ship VbsDeps.cmake as a dependency integration module. Provide new vbs_declare_dependency and vbs_make_available helpers with FetchContent/CPM-style declaration/use separation; do not claim exact macro-level drop-in compatibility.
- Allow CMake consumers to use native registry packages and pinned sources without authoring build.cpp. Normalize requests to the same model/lock protocol as native projects.
- Resolve/fetch/build only during explicit full dependency operations initiated by the CMake bridge. Generate package-config/imported-target files from typed interfaces, preserving transitive requirements, configuration mappings and runtime artifacts.
- Use structured request/result files or argv with correct escaping; avoid shell interpolation. Include requester toolchain/profile/build-target contexts so a host-native package is not substituted into a cross build.
- Share verified package blobs while keeping mutable CMake and provider build directories isolated. Define reentry/cycle diagnostics and no global transaction held over a nested child process.
- Support locked/offline operation and clear vbs executable/version discovery. Missing vbs is a prerequisite, not permission to download an arbitrary unpinned binary.
Implementation sequence
- Freeze helper signatures and versioned native CLI request protocol.
- Implement model normalization and generation of imported targets/config files.
- Integrate multi-config/cross-context mapping and package lock ownership.
- Write consumer examples and test nested dependency/error/cancellation behavior.
Failure behavior and boundaries
- Conflicting declarations identify both CMake origins; no silent first-writer version selection.
- Avoid unescaped CMake lists/semicolons, quotes and paths.
- No native-build-language requirement added to the consuming CMake project's own targets.
- Unsupported interface features fail rather than drop needed transitive flags.
Acceptance scenarios
- CMake executable consumes a native package, a CMake source package and a Meson source package.
- Multiple declarations deduplicate compatible requests and diagnose incompatible ones.
- Multi-config/debug-release/cross-toolchain mapping and offline/locked repeatability.
- Paths with spaces, quotes and semicolons; version mismatch and missing vbs diagnostics.
- Nested package use does not deadlock or overwrite another build's artifacts.
Verification and integration gate
NEW ordinary CMake consumer fixtures configure/build/run against the installed bridge and CLI, separate from building VBS itself. Trace which resolver/provider executes; no production registry needed.
Acceptance requires observed results for these scenarios, the affected regression suite, reviewed cross-component contracts, and a fresh independent review. Record unrun checks and environment limitations; tests passing alone do not waive an invariant. No merge, push or deployment is authorized by a review verdict.
VoidLibrary reuse and upstream candidates
Reuse the native package model and exporter; do not implement a second solver in CMake. CMake code remains dependency glue permitted by the user.
Shared invariants and input/publication policies are defined in ARCHITECTURE; requirement authority is REQUIREMENTS. Return implementation evidence to VERIFICATION.