Remove capy auto-fetch so FetchContent consumers provide it themselves#221
Remove capy auto-fetch so FetchContent consumers provide it themselves#221sgerbino merged 1 commit intocppalliance:developfrom
Conversation
📝 WalkthroughWalkthroughRemoves Corosio's automatic Capy fetching; consumers must provide Capy themselves. CI gains steps that generate a top-level Changes
Sequence Diagram(s)sequenceDiagram
participant CI as GitHub Actions
participant Runner as Job Runner
participant Repo as corosio repo
participant CMake as CMake configure
participant Capy as Capy source (cloned/provided)
CI->>Runner: start matrix job (build-cmake / coverage / clang-tidy)
Runner->>Repo: checkout corosio
Runner->>Repo: generate provide-capy.cmake and set env vars
Runner->>Capy: expose COROSIO_CI_CAPY_DIR (cloned source)
Runner->>CMake: invoke cmake with -D CMAKE_PROJECT_boost_corosio_INCLUDE=provide-capy.cmake and -D COROSIO_CI_CAPY_SOURCE_DIR
CMake->>Repo: include provided capy provider
CMake->>Capy: add_subdirectory(...) or consume provided target
CMake-->>Runner: configure completes using provided Capy
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
|
An automated preview of the documentation is available at https://221.corosio.prtest3.cppalliance.org/index.html If more commits are pushed to the pull request, the docs will rebuild at the same URL. 2026-03-31 21:42:10 UTC |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
.github/workflows/ci.yml (1)
631-632: Quote injected CMake path values for path-safety.These
-Darguments work in current runners, but quoting makes them robust for workspace paths containing spaces.🛠️ Suggested hardening patch
- -D CMAKE_PROJECT_boost_corosio_INCLUDE=${{ env.COROSIO_CI_PROVIDE_CAPY }} - -D COROSIO_CI_CAPY_SOURCE_DIR=${{ env.COROSIO_CI_CAPY_DIR }} + -D CMAKE_PROJECT_boost_corosio_INCLUDE="${{ env.COROSIO_CI_PROVIDE_CAPY }}" + -D COROSIO_CI_CAPY_SOURCE_DIR="${{ env.COROSIO_CI_CAPY_DIR }}" ... - -D CMAKE_PROJECT_boost_corosio_INCLUDE=${{ env.COROSIO_CI_PROVIDE_CAPY }} - -D COROSIO_CI_CAPY_SOURCE_DIR=${{ env.COROSIO_CI_CAPY_DIR }} + -D CMAKE_PROJECT_boost_corosio_INCLUDE="${{ env.COROSIO_CI_PROVIDE_CAPY }}" + -D COROSIO_CI_CAPY_SOURCE_DIR="${{ env.COROSIO_CI_CAPY_DIR }}"Also applies to: 657-658
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/ci.yml around lines 631 - 632, The CMake -D arguments pass unquoted path variables which can break when workspace paths contain spaces; update the invocations that set CMAKE_PROJECT_boost_corosio_INCLUDE and COROSIO_CI_CAPY_SOURCE_DIR (and the similar occurrences for the other two occurrences at the later block) to wrap the injected env values in quotes so the entire path is treated as a single argument by CMake; locate the -D CMAKE_PROJECT_boost_corosio_INCLUDE and -D COROSIO_CI_CAPY_SOURCE_DIR occurrences and add quoting around the ${...} expansions.README.md (1)
18-33: Add a short explanation of the FetchContent arguments after the snippet.The command block is good, but readers still need a brief explanation of why
GIT_TAGandGIT_SHALLOWare set and whatFetchContent_MakeAvailable(capy corosio)guarantees.✍️ Suggested documentation patch
FetchContent_MakeAvailable(capy corosio) target_link_libraries(my_app Boost::corosio)
+This configuration fetches both dependencies and makes their targets available in
+the current build soBoost::corosiocan resolve itsBoost::capylink target.
+GIT_TAGselects the branch to fetch, andGIT_SHALLOW TRUEreduces clone depth
+to speed up dependency retrieval in CI and local configure runs.</details> As per coding guidelines: “In documentation, place all commands on their own line in a code block. Precede with a description of what the command does. After the command, explain arguments and why they're used.” <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@README.mdaround lines 18 - 33, Add a short explanatory paragraph
immediately after the CMake snippet that briefly states that the
FetchContent_Declare calls fetch the capy and corosio dependencies and that
FetchContent_MakeAvailable(capy corosio) makes their CMake targets available in
the current build so Boost::corosio can resolve its Boost::capy link target;
also explain that GIT_TAG selects the branch or commit to fetch and GIT_SHALLOW
TRUE reduces clone depth to speed up CI/local configure runs.</details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/ci.yml:
- Around line 631-632: The CMake -D arguments pass unquoted path variables which
can break when workspace paths contain spaces; update the invocations that set
CMAKE_PROJECT_boost_corosio_INCLUDE and COROSIO_CI_CAPY_SOURCE_DIR (and the
similar occurrences for the other two occurrences at the later block) to wrap
the injected env values in quotes so the entire path is treated as a single
argument by CMake; locate the -D CMAKE_PROJECT_boost_corosio_INCLUDE and -D
COROSIO_CI_CAPY_SOURCE_DIR occurrences and add quoting around the ${...}
expansions.In
@README.md:
- Around line 18-33: Add a short explanatory paragraph immediately after the
CMake snippet that briefly states that the FetchContent_Declare calls fetch the
capy and corosio dependencies and that FetchContent_MakeAvailable(capy corosio)
makes their CMake targets available in the current build so Boost::corosio can
resolve its Boost::capy link target; also explain that GIT_TAG selects the
branch or commit to fetch and GIT_SHALLOW TRUE reduces clone depth to speed up
CI/local configure runs.</details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Path: .coderabbit.yaml **Review profile**: CHILL **Plan**: Pro **Run ID**: `0e13edb6-10f4-42e9-8f70-be02121cd008` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 7d29b692ec1e6e17491308dc52beafeb55a81813 and f9ecacd2339c494274d3c823ef946ac9ece8af56. </details> <details> <summary>📒 Files selected for processing (3)</summary> * `.github/workflows/ci.yml` * `README.md` * `cmake/CorosioBuild.cmake` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
|
GCOVR code coverage report https://221.corosio.prtest3.cppalliance.org/gcovr/index.html Build time: 2026-03-31 21:49:56 UTC |
The three-tier capy resolution (target check, find_package, FetchContent) introduced order dependence and network non-determinism at configure time. Consumers now provide Boost::capy via their own mechanism; CMake resolves the target reference at generation time regardless of declaration order.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@README.md`:
- Around line 21-31: Add explanatory prose around the CMake snippet: for each
FetchContent_Declare call (capy and corosio) add short descriptions of the
keyword arguments GIT_REPOSITORY (where sources are cloned from), GIT_TAG (which
commit/branch/tag to checkout and why 'develop' was chosen), and GIT_SHALLOW
(that it performs a shallow clone to reduce download size), and a sentence after
FetchContent_MakeAvailable explaining that it downloads, configures and makes
the declared projects available to the build (and why calling it here is
necessary). Reference the existing symbols FetchContent_Declare, GIT_REPOSITORY,
GIT_TAG, GIT_SHALLOW, and FetchContent_MakeAvailable in the prose so readers can
map each explanation to the exact command/argument in the snippet.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 53ea5c4f-22dc-44db-9e4a-0bf1734f81a0
📒 Files selected for processing (3)
.github/workflows/ci.ymlREADME.mdcmake/CorosioBuild.cmake
| FetchContent_Declare(capy | ||
| GIT_REPOSITORY https://github.com/cppalliance/capy.git | ||
| GIT_TAG develop | ||
| GIT_SHALLOW TRUE) | ||
| FetchContent_Declare(corosio | ||
| GIT_REPOSITORY https://github.com/cppalliance/corosio.git | ||
| GIT_TAG develop | ||
| GIT_SHALLOW TRUE) | ||
| FetchContent_MakeAvailable(corosio) | ||
|
|
||
| FetchContent_MakeAvailable(capy corosio) | ||
|
|
There was a problem hiding this comment.
Add command/argument explanations around the CMake snippet
The snippet is correct, but it does not explain what each command/argument does (for example GIT_TAG, GIT_SHALLOW, and FetchContent_MakeAvailable(...)) or why those values are used. This repo’s doc rules require that detail for reader guidance.
Suggested doc patch
include(FetchContent)
+# Declare Capy first so CMake knows where to download it from.
+# `GIT_TAG` selects the branch or tag to check out.
+# `GIT_SHALLOW TRUE` reduces clone size and speeds up configure time.
FetchContent_Declare(capy
GIT_REPOSITORY https://github.com/cppalliance/capy.git
GIT_TAG develop
GIT_SHALLOW TRUE)
+# Declare Corosio in the same way.
FetchContent_Declare(corosio
GIT_REPOSITORY https://github.com/cppalliance/corosio.git
GIT_TAG develop
GIT_SHALLOW TRUE)
+# Make both dependencies available to the current build.
+# This ensures `Boost::capy` exists when `Boost::corosio` is linked.
FetchContent_MakeAvailable(capy corosio)As per coding guidelines, “every command includes detailed explanation, and every code block is followed by prose explaining what it does and why.”
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` around lines 21 - 31, Add explanatory prose around the CMake
snippet: for each FetchContent_Declare call (capy and corosio) add short
descriptions of the keyword arguments GIT_REPOSITORY (where sources are cloned
from), GIT_TAG (which commit/branch/tag to checkout and why 'develop' was
chosen), and GIT_SHALLOW (that it performs a shallow clone to reduce download
size), and a sentence after FetchContent_MakeAvailable explaining that it
downloads, configures and makes the declared projects available to the build
(and why calling it here is necessary). Reference the existing symbols
FetchContent_Declare, GIT_REPOSITORY, GIT_TAG, GIT_SHALLOW, and
FetchContent_MakeAvailable in the prose so readers can map each explanation to
the exact command/argument in the snippet.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #221 +/- ##
========================================
Coverage 77.89% 77.89%
========================================
Files 96 96
Lines 7369 7369
Branches 1794 1794
========================================
Hits 5740 5740
Misses 1110 1110
Partials 519 519 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
The three-tier capy resolution (target check, find_package, FetchContent) introduced order dependence and network non-determinism at configure time. Consumers now provide Boost::capy via their own mechanism; CMake resolves the target reference at generation time regardless of declaration order.
Resolves #217.
Summary by CodeRabbit
Documentation
Build Changes
CI/CD Updates