chore(cmake): adopt submodule-first deps and standardize FetchContent usage#141
Closed
mmorel-35 wants to merge 1 commit intoSkyAPM:mainfrom
Closed
chore(cmake): adopt submodule-first deps and standardize FetchContent usage#141mmorel-35 wants to merge 1 commit intoSkyAPM:mainfrom
mmorel-35 wants to merge 1 commit intoSkyAPM:mainfrom
Conversation
092db69 to
6eb1520
Compare
19aa619 to
121707c
Compare
db42b30 to
b2f21d3
Compare
… usage - Adopt a "submodule-first, FetchContent-fallback" strategy for third-party dependencies: - Default `*_FETCHCONTENT` to OFF in top-level `CMakeLists.txt` and prefer pinned submodules under `3rdparty/`. - Each `cmake/*.cmake` module auto-detects a local submodule and enables FetchContent only as a fallback when the submodule is absent. - Auto-detection is non-authoritative (does not FORCE cache values) so `-D` overrides from users take precedence; a sanity check fails when the user explicitly requests both modes. - Add and pin third-party submodules (commits/tags): - `3rdparty/spdlog` (pinned) - `3rdparty/fmt` (pinned to 8.1.1) - `3rdparty/httplib` (pinned to v0.22.0) - `3rdparty/skywalking-data-collect-protocol` (pinned to v10.3.0) - `3rdparty/grpc` (pinned to v1.74.1) - Standardize FetchContent declarations: - Use `GIT_REPOSITORY` + `GIT_TAG` (via `*_GIT_URL` / `*_GIT_TAG` variables) for FetchContent where appropriate so pins can be tags or commit SHAs. - For gRPC, support archive or git+tag; when using git clone, initialize nested submodules after `FetchContent_Populate`. - Move and tidy dependency logic: - Move auto-detection and conflict validation into each dependency module (`cmake/*.cmake`) to keep `CMakeLists.txt` lean. - Disable `*_FETCHCONTENT` automatically only when the submodule is present and the user has not explicitly requested FetchContent. - CI and docs: - Update CI (`.github/workflows/main.yml`) to checkout submodules recursively and build gRPC from `3rdparty/grpc`. - Update `README.md` documenting submodule-first workflow, FetchContent fallback, `GIT_REPOSITORY+GIT_TAG` usage, and the bump procedure. - Additions and refactors: - Add `cmake/skywalking.cmake` and expose `SKYWALKING_PROTOCOL_PATH` for `proto2cpp`. - Harmonize FetchContent usage and expose `*_GIT_URL` / `*_GIT_TAG` variables for maintainability. Why - Improves reproducibility and developer ergonomics by making dependency pins explicit and consistent. - Allows local `-D` overrides for advanced use-cases or debugging while keeping CI deterministic. Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
b2f21d3 to
c0c3bc6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adopt a "submodule-first, FetchContent-fallback" strategy for third-party dependencies:
*_FETCHCONTENTto OFF in top-levelCMakeLists.txtand prefer pinned submodules under3rdparty/.cmake/*.cmakemodule auto-detects a local submodule and enables FetchContent only as a fallback when the submodule is absent.-Doverrides from users take precedence; a sanity check fails when the user explicitly requests both modes.Add and pin third-party submodules (commits/tags):
3rdparty/spdlog(pinned)3rdparty/fmt(pinned to 8.1.1)3rdparty/httplib(pinned to v0.22.0)3rdparty/skywalking-data-collect-protocol(pinned to v10.3.0)3rdparty/grpc(pinned to v1.74.1)Standardize FetchContent declarations:
GIT_REPOSITORY+GIT_TAG(via*_GIT_URL/*_GIT_TAGvariables) for FetchContent where appropriate so pins can be tags or commit SHAs.FetchContent_Populate.Move and tidy dependency logic:
cmake/*.cmake) to keepCMakeLists.txtlean.*_FETCHCONTENTautomatically only when the submodule is present and the user has not explicitly requested FetchContent.CI and docs:
.github/workflows/main.yml) to checkout submodules recursively and build gRPC from3rdparty/grpc.README.mddocumenting submodule-first workflow, FetchContent fallback,GIT_REPOSITORY+GIT_TAGusage, and the bump procedure.Additions and refactors:
cmake/skywalking.cmakeand exposeSKYWALKING_PROTOCOL_PATHforproto2cpp.*_GIT_URL/*_GIT_TAGvariables for maintainability.Why
-Doverrides for advanced use-cases or debugging while keeping CI deterministic.