From 6a68ee477f5cd05e9962983489453fed97af796e Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Thu, 23 Oct 2025 10:59:18 -0400 Subject: [PATCH 01/14] refine taskfile --- taskfiles/deps/main.yaml | 186 ++++++++++++++------------------------- 1 file changed, 66 insertions(+), 120 deletions(-) diff --git a/taskfiles/deps/main.yaml b/taskfiles/deps/main.yaml index bbfbc71007..a0ffbf3d3d 100644 --- a/taskfiles/deps/main.yaml +++ b/taskfiles/deps/main.yaml @@ -158,94 +158,42 @@ tasks: antlr-jar: internal: true - vars: - CHECKSUM_FILE: "{{.G_DEPS_CPP_CHECKSUMS_DIR}}/antlr-jar.md5" - OUTPUT_FILE: "{{.G_ANTLR_JAR_FILE}}" run: "once" deps: - - task: "yscope-dev-utils:checksum:validate" - vars: - CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" - INCLUDE_PATTERNS: - - "{{.OUTPUT_FILE}}" - task: "utils:init" cmds: - task: "yscope-dev-utils:remote:curl" vars: FILE_SHA256: "eae2dfa119a64327444672aff63e9ec35a20180dc5b8090b7a6ab85125df4d76" - OUTPUT_FILE: "{{.OUTPUT_FILE}}" + OUTPUT_FILE: "{{.G_ANTLR_JAR_FILE}}" URL: "https://www.antlr.org/download/antlr-{{.G_ANTLR_VERSION}}-complete.jar" - # This command must be last - - task: "yscope-dev-utils:checksum:compute" - vars: - CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" - INCLUDE_PATTERNS: - - "{{.OUTPUT_FILE}}" - antlr-runtime: internal: true run: "once" - vars: - LIB_NAME: "antlr4-runtime" - - # Paths - BUILD_DIR: "{{.G_DEPS_CPP_DIR}}/{{.LIB_NAME}}-build" - CHECKSUM_FILE: "{{.G_DEPS_CPP_CHECKSUMS_DIR}}/{{.LIB_NAME}}.md5" - INSTALL_PREFIX: "{{.G_DEPS_CPP_DIR}}/{{.LIB_NAME}}-install" - SOURCE_DIR: "{{.G_DEPS_CPP_DIR}}/{{.LIB_NAME}}-src" - deps: - - task: "utils:init" - - task: "yscope-dev-utils:checksum:validate" - vars: - CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" - INCLUDE_PATTERNS: ["{{.INSTALL_PREFIX}}"] - - # NOTE: We can't use `yscope-dev-utils:cmake:install-remote-tar` (and by extension - # `utils:install-remote-cmake-lib`) since it doesn't yet support the `INCLUDE_PATTERNS` and - # `NUM_COMPONENTS_TO_STRIP` parameters. cmds: - - task: "yscope-dev-utils:remote:download-and-extract-tar" - vars: - FILE_SHA256: "9f18272a9b32b622835a3365f850dd1063d60f5045fb1e12ce475ae6e18a35bb" - INCLUDE_PATTERNS: ["*/runtime/Cpp"] - NUM_COMPONENTS_TO_STRIP: 3 - OUTPUT_DIR: "{{.SOURCE_DIR}}" - URL: "https://github.com/antlr/antlr4/archive/refs/tags/{{.G_ANTLR_VERSION}}.tar.gz" - - task: "yscope-dev-utils:cmake:generate" + - task: "utils:install-remote-cmake-lib" vars: - BUILD_DIR: "{{.BUILD_DIR}}" - EXTRA_ARGS: + CMAKE_GEN_ARGS: - "-DANTLR4_INSTALL=ON" + - "-DANTLR_BUILD_CPP_TESTS=OFF" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" # Set CMP0135 so that extracted files use the current timestamp as their modification # timestamp, which ensures the library gets rebuilt if the extracted files change. - "-DCMAKE_POLICY_DEFAULT_CMP0135=NEW" - SOURCE_DIR: "{{.SOURCE_DIR}}" - - task: "yscope-dev-utils:cmake:build" - vars: - BUILD_DIR: "{{.BUILD_DIR}}" - JOBS: "{{.G_CPP_MAX_PARALLELISM_PER_BUILD_TASK}}" - - task: "yscope-dev-utils:cmake:install" - vars: - BUILD_DIR: "{{.BUILD_DIR}}" - CMAKE_PACKAGE_NAME: "{{.LIB_NAME}}" - CMAKE_SETTINGS_DIR: "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}" - INSTALL_PREFIX: "{{.INSTALL_PREFIX}}" - - # This command must be last - - task: "yscope-dev-utils:checksum:compute" - vars: - CHECKSUM_FILE: "{{.CHECKSUM_FILE}}" - INCLUDE_PATTERNS: ["{{.INSTALL_PREFIX}}"] + CMAKE_SOURCE_DIR: "runtime/Cpp" + LIB_NAME: "antlr4-runtime" + TARBALL_SHA256: "9f18272a9b32b622835a3365f850dd1063d60f5045fb1e12ce475ae6e18a35bb" + TARBALL_URL: "https://github.com/antlr/antlr4/archive/refs/tags/\ + {{.G_ANTLR_VERSION}}.tar.gz" boost: internal: true - vars: - VERSION: "1.87.0" run: "once" + deps: + - task: "utils:init" cmds: - task: "yscope-dev-utils:boost:download-and-install" vars: @@ -259,8 +207,8 @@ tasks: - "regex" - "system" - "url" - URL: "https://github.com/boostorg/boost/releases/download/boost-{{.VERSION}}/\ - boost-{{.VERSION}}-b2-nodocs.tar.gz" + URL: "https://github.com/boostorg/boost/releases/download/boost-1.87.0/\ + boost-1.87.0-b2-nodocs.tar.gz" WORK_DIR: "{{.G_DEPS_CPP_DIR}}" catch2: @@ -270,7 +218,9 @@ tasks: - task: "utils:install-remote-cmake-lib" vars: CMAKE_GEN_ARGS: - - "-DBUILD_TESTING=OFF" + - "-DCATCH_BUILD_TESTING=OFF" + - "-DCATCH_INSTALL_DOCS=OFF" + - "-DCATCH_INSTALL_EXTRAS=OFF" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_CXX_STANDARD=20" - "-DCMAKE_CXX_STANDARD_REQUIRED=ON" @@ -299,6 +249,7 @@ tasks: - task: "utils:install-remote-cmake-lib" vars: CMAKE_GEN_ARGS: + - "-DBUILD_SHARED_LIBS=ON" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" - "-DFMT_DOC=OFF" @@ -309,51 +260,42 @@ tasks: liblzma: internal: true - vars: - COMMON_CMAKE_GEN_ARGS: - - "-DBUILD_TESTING=OFF" - - "-DCMAKE_BUILD_TYPE=Release" - - "-DCMAKE_INSTALL_MESSAGE=LAZY" - - "-DXZ_DOC=OFF" - - "-DXZ_TOOL_LZMADEC=OFF" - - "-DXZ_TOOL_LZMAINFO=OFF" - - "-DXZ_TOOL_SCRIPTS=OFF" - - "-DXZ_TOOL_SYMLINKS_LZMA=OFF" - - "-DXZ_TOOL_XZ=OFF" - - "-DXZ_TOOL_XZDEC=OFF" - TARBALL_SHA256: "507825b599356c10dca1cd720c9d0d0c9d5400b9de300af00e4d1ea150795543" - TARBALL_URL: "https://github.com/tukaani-project/xz/releases/download/v5.8.1/xz-5.8.1.tar.gz" run: "once" deps: - task: "liblzma-install" vars: BUILD_SHARED_LIBS: true - COMMON_CMAKE_GEN_ARGS: - ref: ".COMMON_CMAKE_GEN_ARGS" - TARBALL_SHA256: "{{.TARBALL_SHA256}}" - TARBALL_URL: "{{.TARBALL_URL}}" - task: "liblzma-install" vars: BUILD_SHARED_LIBS: false - COMMON_CMAKE_GEN_ARGS: - ref: ".COMMON_CMAKE_GEN_ARGS" - TARBALL_SHA256: "{{.TARBALL_SHA256}}" - TARBALL_URL: "{{.TARBALL_URL}}" liblzma-install: internal: true + vars: + LIBLZMA_CMAKE_GEN_ARGS: + - "-DBUILD_TESTING=OFF" + - "-DCMAKE_BUILD_TYPE=Release" + - "-DCMAKE_INSTALL_MESSAGE=LAZY" + - "-DXZ_DOC=OFF" + - "-DXZ_TOOL_LZMADEC=OFF" + - "-DXZ_TOOL_LZMAINFO=OFF" + - "-DXZ_TOOL_SCRIPTS=OFF" + - "-DXZ_TOOL_SYMLINKS_LZMA=OFF" + - "-DXZ_TOOL_XZ=OFF" + - "-DXZ_TOOL_XZDEC=OFF" requires: - vars: ["BUILD_SHARED_LIBS", "COMMON_CMAKE_GEN_ARGS", "TARBALL_SHA256", "TARBALL_URL"] + vars: ["BUILD_SHARED_LIBS"] cmds: - task: "utils:install-remote-cmake-lib" vars: CMAKE_GEN_ARGS: - "-DBUILD_SHARED_LIBS={{ if .BUILD_SHARED_LIBS }}ON{{ else }}OFF{{ end }}" - >- - {{ join " " .COMMON_CMAKE_GEN_ARGS }} + {{ join " " .LIBLZMA_CMAKE_GEN_ARGS }} LIB_NAME: "LibLZMA-{{ if .BUILD_SHARED_LIBS }}shared{{ else }}static{{ end }}" - TARBALL_SHA256: "{{.TARBALL_SHA256}}" - TARBALL_URL: "{{.TARBALL_URL}}" + TARBALL_SHA256: "507825b599356c10dca1cd720c9d0d0c9d5400b9de300af00e4d1ea150795543" + TARBALL_URL: "https://github.com/tukaani-project/xz/releases/download/v5.8.1/\ + xz-5.8.1.tar.gz" log-surgeon: internal: true @@ -392,6 +334,7 @@ tasks: TARBALL_URL: "https://github.com/lz4/lz4/releases/download/v1.10.0/lz4-1.10.0.tar.gz" mariadb-connector-cpp: + internal: true platforms: ["linux"] preconditions: # NOTE: The MariaDB connector is only required for building Spider, which is only supported on @@ -399,19 +342,21 @@ tasks: # - Update the precondition accordingly. # - Make `INSTALL_LAYOUT` configurable. - >- - source /etc/os-release && [[ "$ID" == "ubuntu" ]] - internal: true + . /etc/os-release && [ "$ID" = "ubuntu" ] run: "once" cmds: - task: "utils:install-remote-cmake-lib" vars: CMAKE_GEN_ARGS: - - "-DUSE_SYSTEM_INSTALLED_LIB=ON" + - "-DCMAKE_BUILD_TYPE=Release" + - "-DCMAKE_INSTALL_MESSAGE=LAZY" - "-DINSTALL_LAYOUT=DEB" + - "-DUSE_SYSTEM_INSTALLED_LIB=ON" + - "-DWITH_UNIT_TESTS=OFF" LIB_NAME: "mariadb-connector-cpp" + TARBALL_SHA256: "0e3dfe9f2bc3f7bb6f7c159009556290064a7c23402ea08019fa8aebfc3ff2c9" TARBALL_URL: "https://github.com/mariadb-corporation/mariadb-connector-cpp/archive/refs/\ tags/1.1.5.tar.gz" - TARBALL_SHA256: "0e3dfe9f2bc3f7bb6f7c159009556290064a7c23402ea08019fa8aebfc3ff2c9" microsoft.gsl: internal: true @@ -429,8 +374,6 @@ tasks: mongocxx: internal: true - vars: - VERSION: "r4.1.1" run: "once" cmds: - task: "utils:install-remote-cmake-lib" @@ -440,16 +383,15 @@ tasks: - "-DBUILD_SHARED_LIBS_WITH_STATIC_MONGOC=ON" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" + - "-DENABLE_EXAMPLES=OFF" - "-DENABLE_UNINSTALL=OFF" LIB_NAME: "mongocxx" TARBALL_SHA256: "19dff3cf834a3e09229260f22a0325820a7e30c78b294db91794dd934776b33a" - TARBALL_URL: "https://github.com/mongodb/mongo-cxx-driver/releases/download/{{.VERSION}}\ - /mongo-cxx-driver-{{.VERSION}}.tar.gz" + TARBALL_URL: "https://github.com/mongodb/mongo-cxx-driver/releases/download/r4.1.1\ + /mongo-cxx-driver-r4.1.1.tar.gz" msgpack-cxx: internal: true - vars: - VERSION: "7.0.0" run: "once" deps: - task: "boost" @@ -465,8 +407,8 @@ tasks: - "-DMSGPACK_CXX20=ON" LIB_NAME: "msgpack-cxx" TARBALL_SHA256: "7504b7af7e7b9002ce529d4f941e1b7fb1fb435768780ce7da4abaac79bb156f" - TARBALL_URL: "https://github.com/msgpack/msgpack-c/releases/download/cpp-{{.VERSION}}\ - /msgpack-cxx-{{.VERSION}}.tar.gz" + TARBALL_URL: "https://github.com/msgpack/msgpack-c/releases/download/cpp-7.0.0\ + /msgpack-cxx-7.0.0.tar.gz" nlohmann_json: internal: true @@ -493,8 +435,10 @@ tasks: - task: "utils:install-remote-cmake-lib" vars: CMAKE_GEN_ARGS: + - "-DBUILD_SHARED_LIBS=ON" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" + - "-DSIMDJSON_BUILD_STATIC_LIB=ON" LIB_NAME: "simdjson" TARBALL_SHA256: "07a1bb3587aac18fd6a10a83fe4ab09f1100ab39f0cb73baea1317826b9f9e0d" TARBALL_URL: "https://github.com/simdjson/simdjson/archive/refs/tags/v3.13.0.tar.gz" @@ -513,7 +457,7 @@ tasks: - "-DCMAKE_INSTALL_MESSAGE=LAZY" - "-DCMAKE_POLICY_DEFAULT_CMP0074=NEW" - "-DSPDLOG_BUILD_EXAMPLE=OFF" - - "-DSPDLOG_BUILD_EXAMPLE_HO=OFF" + - "-DSPDLOG_BUILD_SHARED=ON" - "-DSPDLOG_FMT_EXTERNAL=ON" LIB_NAME: "spdlog" TARBALL_SHA256: "15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67" @@ -528,7 +472,7 @@ tasks: LIB_NAME: "sqlite3" # Paths - EXTRACTION_DIR: "{{.G_DEPS_CPP_DIR}}/{{.LIB_NAME}}-src" + EXTRACTION_DIR: "{{.G_DEPS_CPP_DIR}}/{{.LIB_NAME}}-extracted" INSTALL_INCLUDE_DIR: "{{.G_DEPS_CPP_DIR}}/{{.LIB_NAME}}-install/include" INSTALL_SYMLINK: "{{.INSTALL_INCLUDE_DIR}}/{{.LIB_NAME}}" ZIP_FILENAME_STEM: "sqlite-amalgamation-3360000" @@ -543,34 +487,35 @@ tasks: FILE_SHA256: "999826fe4c871f18919fdb8ed7ec9dd8217180854dd1fe21eea96aed36186729" OUTPUT_DIR: "{{.EXTRACTION_DIR}}" URL: "https://www.sqlite.org/2021/{{.ZIP_FILENAME_STEM}}.zip" - - "mkdir -p '{{.INSTALL_INCLUDE_DIR}}'" - - "rm -f '{{.INSTALL_SYMLINK}}'" - - "ln -s '{{.SRC_DIR}}' '{{.INSTALL_SYMLINK}}'" - |- - echo "set(CLP_SQLITE3_SOURCE_DIRECTORY \"{{.SRC_DIR}}\")" \ - > "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}/{{.LIB_NAME}}.cmake" - echo "set(CLP_SQLITE3_INCLUDE_DIRECTORY \"{{.INSTALL_INCLUDE_DIR}}\")" \ - >> "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}/{{.LIB_NAME}}.cmake" + mkdir -p "{{.INSTALL_INCLUDE_DIR}}" + ln -sfn "{{.SRC_DIR}}" "{{.INSTALL_SYMLINK}}" + cat > "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}/{{.LIB_NAME}}.cmake" <- - echo "set( - CLP_UTFCPP_INCLUDE_DIRECTORY \"{{.UTFCPP_OUTPUT_DIR}}\" - )" > "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}/{{.LIB_NAME}}.cmake" + - |- + cat > "{{.G_DEPS_CPP_CMAKE_SETTINGS_DIR}}/{{.LIB_NAME}}.cmake" < Date: Thu, 23 Oct 2025 15:52:37 +0000 Subject: [PATCH 02/14] fix indent --- taskfiles/deps/main.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/taskfiles/deps/main.yaml b/taskfiles/deps/main.yaml index a0ffbf3d3d..3fb1452719 100644 --- a/taskfiles/deps/main.yaml +++ b/taskfiles/deps/main.yaml @@ -334,7 +334,7 @@ tasks: TARBALL_URL: "https://github.com/lz4/lz4/releases/download/v1.10.0/lz4-1.10.0.tar.gz" mariadb-connector-cpp: - internal: true + internal: true platforms: ["linux"] preconditions: # NOTE: The MariaDB connector is only required for building Spider, which is only supported on @@ -342,7 +342,7 @@ tasks: # - Update the precondition accordingly. # - Make `INSTALL_LAYOUT` configurable. - >- - . /etc/os-release && [ "$ID" = "ubuntu" ] + . /etc/os-release && [ "$ID" = "ubuntu" ] run: "once" cmds: - task: "utils:install-remote-cmake-lib" From 060a0ba56538d7d99edf4837ad881d029edd40a9 Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Thu, 23 Oct 2025 12:02:11 -0400 Subject: [PATCH 03/14] Add guidelines for writing taskfiles --- taskfiles/deps/README.md | 36 ++++++++++++++++++++++++++++++++++++ taskfiles/deps/main.yaml | 4 ---- 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 taskfiles/deps/README.md diff --git a/taskfiles/deps/README.md b/taskfiles/deps/README.md new file mode 100644 index 0000000000..05fb09c3a1 --- /dev/null +++ b/taskfiles/deps/README.md @@ -0,0 +1,36 @@ +# Dependency Taskfiles + +Follow the guidelines below when writing and updating dependency installation taskfiles. + +- Use `deps:utils:install-remote-cmake-lib` and thus `yscope-dev-utils:cmake:install-remote-tar` + whenever it applies. For respective task of other libraries/components: + - Include `deps:utils:init` in the `deps:` section of the task. + - Explain why we aren't installing it if it is a CMake project that's installable. + - Ensure that they have proper checksum mechanisms to check if they are up-to-date. + - Use `-extracted` as the folder name for the contents extracted from the downloaded tarball. + +- Avoid parsing the version number from the download URL unless it is needed elsewhere. Since URL + formats can change over time, it’s more maintainable to use the full URL directly as plain text. + +## CMake Generate Arguments + +The following guidelines apply to flags in the `CMAKE_GEN_ARGS` section of tasks that call +`deps:utils:install-remote-cmake-lib`: + +- Set `CMP0074` to `NEW` in `CMAKE_GEN_ARGS` whenever: + - The component's minimum required CMake version is less than 3.27 (where CMP0074 defaults to OLD) + - The component depends on another via `_ROOT`. + +- Attempt to build both shared and static libraries for each dependency. + +- Avoid building unit tests, examples, docs or binaries that are unused to speed up the install + process. + +- Choose to turn off lib-specific build testing flag instead of `BUILD_TESTING` if possible. + +- Set `CMAKE_BUILD_TYPE` to `Release` if another build type is not strictly required. + +- Set `CMAKE_INSTALL_MESSAGE` to `LAZY` to avoid clobbering of the log screen. + +- Do not include flags that are no-op, including the ones that merely set variables to their + default values found in `CMakeLists.txt` and other cmake files used to generate `CMakeCache.txt`. diff --git a/taskfiles/deps/main.yaml b/taskfiles/deps/main.yaml index 3fb1452719..6321607083 100644 --- a/taskfiles/deps/main.yaml +++ b/taskfiles/deps/main.yaml @@ -27,10 +27,6 @@ vars: G_ANTLR_VERSION: "4.13.2" G_ANTLR_JAR_FILE: "{{.G_DEPS_CPP_DIR}}/antlr-{{.G_ANTLR_VERSION}}-complete.jar" -# NOTE: For dependencies built using CMake, we set CMP0074 to NEW whenever: -# - a component's minimum required CMake version is less than 3.27 (where CMP0074 defaults to OLD); -# and -# - the component depends on another via `_ROOT`. tasks: default: deps: From efde834c9a9d4e3b0297ddbc6440448bcede2b1d Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Thu, 23 Oct 2025 16:17:55 +0000 Subject: [PATCH 04/14] Improve README --- taskfiles/deps/README.md | 42 +++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/taskfiles/deps/README.md b/taskfiles/deps/README.md index 05fb09c3a1..f05c0fc3e0 100644 --- a/taskfiles/deps/README.md +++ b/taskfiles/deps/README.md @@ -1,36 +1,38 @@ # Dependency Taskfiles -Follow the guidelines below when writing and updating dependency installation taskfiles. +Follow the guidelines below when writing or updating dependency installation taskfiles. - Use `deps:utils:install-remote-cmake-lib` and thus `yscope-dev-utils:cmake:install-remote-tar` - whenever it applies. For respective task of other libraries/components: + whenever applicable. + +- For ones that don't apply: - Include `deps:utils:init` in the `deps:` section of the task. - - Explain why we aren't installing it if it is a CMake project that's installable. - - Ensure that they have proper checksum mechanisms to check if they are up-to-date. - - Use `-extracted` as the folder name for the contents extracted from the downloaded tarball. + - Briefly explain why if the library is installable via CMake. + - Verify that each library has proper checksum validation to check if it is up-to-date. + - Use `-extracted` as the directory name for tarball extractions. -- Avoid parsing the version number from the download URL unless it is needed elsewhere. Since URL - formats can change over time, it’s more maintainable to use the full URL directly as plain text. +- Avoid parsing version numbers from download URLs unless the version is used elsewhere. + - URL formats can change over time, so it’s more maintainable to store and use the full URL + directly as plain text. ## CMake Generate Arguments -The following guidelines apply to flags in the `CMAKE_GEN_ARGS` section of tasks that call +Apply the following guidelines to the `CMAKE_GEN_ARGS` section of tasks that call `deps:utils:install-remote-cmake-lib`: -- Set `CMP0074` to `NEW` in `CMAKE_GEN_ARGS` whenever: - - The component's minimum required CMake version is less than 3.27 (where CMP0074 defaults to OLD) +- Set `CMP0074` to `NEW` whenever: + - The component's minimum required CMake version is less than 3.27 (where `CMP0074` defaults to + `OLD`) - The component depends on another via `_ROOT`. -- Attempt to build both shared and static libraries for each dependency. - -- Avoid building unit tests, examples, docs or binaries that are unused to speed up the install - process. - -- Choose to turn off lib-specific build testing flag instead of `BUILD_TESTING` if possible. +- Build both shared and static libraries when possible. -- Set `CMAKE_BUILD_TYPE` to `Release` if another build type is not strictly required. +- Skip unit tests, examples, docs or unused binaries to speed up the install process. -- Set `CMAKE_INSTALL_MESSAGE` to `LAZY` to avoid clobbering of the log screen. +- Prefer disabling lib-specific testing flags (e.g., `CATCH_BUILD_TESTING=OFF`) rather than setting + the generic `BUILD_TESTING` to `OFF`. -- Do not include flags that are no-op, including the ones that merely set variables to their - default values found in `CMakeLists.txt` and other cmake files used to generate `CMakeCache.txt`. +- **Lastly**, while satisfying the above requirements, remove redundant flags that merely restate + default values found in `CMakeLists.txt` and others source CMake files, with two exceptions: + - Set `CMAKE_BUILD_TYPE` to `Release` unless another build type is explicitly required. + - Set `CMAKE_INSTALL_MESSAGE` to `LAZY` to reduce log verbosity during installation. From feceebc480b44c8f0c37a6000913a557eac6bcf9 Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Mon, 27 Oct 2025 13:52:26 -0400 Subject: [PATCH 05/14] Address review --- taskfiles/deps/README.md | 12 +++++++----- taskfiles/deps/main.yaml | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/taskfiles/deps/README.md b/taskfiles/deps/README.md index f05c0fc3e0..617cef8a35 100644 --- a/taskfiles/deps/README.md +++ b/taskfiles/deps/README.md @@ -2,16 +2,18 @@ Follow the guidelines below when writing or updating dependency installation taskfiles. -- Use `deps:utils:install-remote-cmake-lib` and thus `yscope-dev-utils:cmake:install-remote-tar` - whenever applicable. +- Use one of the following tasks for installation, in descending order of preference: + - `deps:utils:install-remote-cmake-lib` + - `yscope-dev-utils:cmake:install-remote-tar` -- For ones that don't apply: +- For special tasks that don't apply to the rule above: - Include `deps:utils:init` in the `deps:` section of the task. - Briefly explain why if the library is installable via CMake. - - Verify that each library has proper checksum validation to check if it is up-to-date. + - Ensure each library installation includes checksum validation using best effort. + - Use of `yscope-dev-utils` tasks is encouraged, as most of them include proper checksum checks. - Use `-extracted` as the directory name for tarball extractions. -- Avoid parsing version numbers from download URLs unless the version is used elsewhere. +- Avoid parsing version numbers in download URLs unless the version is used elsewhere. - URL formats can change over time, so it’s more maintainable to store and use the full URL directly as plain text. diff --git a/taskfiles/deps/main.yaml b/taskfiles/deps/main.yaml index 5f833c149b..6636bdfe12 100644 --- a/taskfiles/deps/main.yaml +++ b/taskfiles/deps/main.yaml @@ -93,7 +93,7 @@ tasks: preconditions: # NOTE: Spider is only supported on Ubuntu at present. - >- - source /etc/os-release && [[ "$ID" == "ubuntu" ]] + . /etc/os-release && [ "$ID" == "ubuntu" ] cmds: - task: "yscope-dev-utils:cmake:install-remote-tar" vars: From 6c64a5b1993cd2bcfdb5bfa121aa3f264fe118e9 Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Mon, 27 Oct 2025 13:54:14 -0400 Subject: [PATCH 06/14] Address coderabbitai comments --- taskfiles/deps/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/taskfiles/deps/README.md b/taskfiles/deps/README.md index 617cef8a35..314b4d7620 100644 --- a/taskfiles/deps/README.md +++ b/taskfiles/deps/README.md @@ -13,9 +13,9 @@ Follow the guidelines below when writing or updating dependency installation tas - Use of `yscope-dev-utils` tasks is encouraged, as most of them include proper checksum checks. - Use `-extracted` as the directory name for tarball extractions. -- Avoid parsing version numbers in download URLs unless the version is used elsewhere. - - URL formats can change over time, so it’s more maintainable to store and use the full URL - directly as plain text. +- Avoid parsing version numbers in download URLs unless the version is used elsewhere, as URL + formats can change over time, making it more maintainable to store and use the full URL directly + as plain text. ## CMake Generate Arguments @@ -36,5 +36,5 @@ Apply the following guidelines to the `CMAKE_GEN_ARGS` section of tasks that cal - **Lastly**, while satisfying the above requirements, remove redundant flags that merely restate default values found in `CMakeLists.txt` and others source CMake files, with two exceptions: - - Set `CMAKE_BUILD_TYPE` to `Release` unless another build type is explicitly required. - - Set `CMAKE_INSTALL_MESSAGE` to `LAZY` to reduce log verbosity during installation. + - Set `CMAKE_BUILD_TYPE` to `Release` unless another build type is explicitly required. + - Set `CMAKE_INSTALL_MESSAGE` to `LAZY` to reduce log verbosity during installation. From b61382f73598e03414d983fb6079923a72414c45 Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Sat, 8 Nov 2025 00:04:00 +0800 Subject: [PATCH 07/14] Update taskfiles/deps/README.md Co-authored-by: Lin Zhihao <59785146+LinZhihao-723@users.noreply.github.com> --- taskfiles/deps/README.md | 42 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/taskfiles/deps/README.md b/taskfiles/deps/README.md index 314b4d7620..ee60e7219f 100644 --- a/taskfiles/deps/README.md +++ b/taskfiles/deps/README.md @@ -2,18 +2,18 @@ Follow the guidelines below when writing or updating dependency installation taskfiles. -- Use one of the following tasks for installation, in descending order of preference: - - `deps:utils:install-remote-cmake-lib` - - `yscope-dev-utils:cmake:install-remote-tar` - -- For special tasks that don't apply to the rule above: - - Include `deps:utils:init` in the `deps:` section of the task. - - Briefly explain why if the library is installable via CMake. - - Ensure each library installation includes checksum validation using best effort. - - Use of `yscope-dev-utils` tasks is encouraged, as most of them include proper checksum checks. - - Use `-extracted` as the directory name for tarball extractions. - -- Avoid parsing version numbers in download URLs unless the version is used elsewhere, as URL +* Use one of the following tasks for installation, in descending order of preference: + * `deps:utils:install-remote-cmake-lib` + * `yscope-dev-utils:cmake:install-remote-tar` + +* For special tasks that don't apply to the rule above: + * Include `deps:utils:init` in the `deps` section of the task. + * Briefly explain why if the library is installable via CMake. + * Ensure each library installation includes checksum validation using the best effort. + * Use of `yscope-dev-utils` tasks is encouraged, as most of them include proper checksum checks. + * Use `-extracted` as the directory name for tarball extractions. + +* Avoid parsing version numbers in download URLs unless the version is used elsewhere, as URL formats can change over time, making it more maintainable to store and use the full URL directly as plain text. @@ -22,19 +22,19 @@ Follow the guidelines below when writing or updating dependency installation tas Apply the following guidelines to the `CMAKE_GEN_ARGS` section of tasks that call `deps:utils:install-remote-cmake-lib`: -- Set `CMP0074` to `NEW` whenever: - - The component's minimum required CMake version is less than 3.27 (where `CMP0074` defaults to +* Set `CMP0074` to `NEW` whenever: + * The component's minimum required CMake version is less than 3.27 (where `CMP0074` defaults to `OLD`) - - The component depends on another via `_ROOT`. + * The component depends on another via `_ROOT`. -- Build both shared and static libraries when possible. +* Build both shared and static libraries when possible. -- Skip unit tests, examples, docs or unused binaries to speed up the install process. +* Skip unit tests, examples, docs or unused binaries to speed up the installation process. -- Prefer disabling lib-specific testing flags (e.g., `CATCH_BUILD_TESTING=OFF`) rather than setting +* Prefer disabling lib-specific testing flags (e.g., `CATCH_BUILD_TESTING=OFF`) rather than setting the generic `BUILD_TESTING` to `OFF`. -- **Lastly**, while satisfying the above requirements, remove redundant flags that merely restate +* **Lastly**, while satisfying the above requirements, remove redundant flags that merely restate default values found in `CMakeLists.txt` and others source CMake files, with two exceptions: - - Set `CMAKE_BUILD_TYPE` to `Release` unless another build type is explicitly required. - - Set `CMAKE_INSTALL_MESSAGE` to `LAZY` to reduce log verbosity during installation. + * Set `CMAKE_BUILD_TYPE` to `Release` unless another build type is explicitly required. + * Set `CMAKE_INSTALL_MESSAGE` to `LAZY` to reduce log verbosity during installation. From e75c8ded9ae24d74d9aae5d26758c3bfdf994811 Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Sat, 8 Nov 2025 00:24:41 +0800 Subject: [PATCH 08/14] Update taskfiles/deps/README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- taskfiles/deps/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taskfiles/deps/README.md b/taskfiles/deps/README.md index ee60e7219f..68babaa7f5 100644 --- a/taskfiles/deps/README.md +++ b/taskfiles/deps/README.md @@ -35,6 +35,6 @@ Apply the following guidelines to the `CMAKE_GEN_ARGS` section of tasks that cal the generic `BUILD_TESTING` to `OFF`. * **Lastly**, while satisfying the above requirements, remove redundant flags that merely restate - default values found in `CMakeLists.txt` and others source CMake files, with two exceptions: + default values found in `CMakeLists.txt` and other source CMake files, with two exceptions: * Set `CMAKE_BUILD_TYPE` to `Release` unless another build type is explicitly required. * Set `CMAKE_INSTALL_MESSAGE` to `LAZY` to reduce log verbosity during installation. From 12f57c16ea8eb93f3c53af3c64d30cc0a770706d Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Sat, 8 Nov 2025 00:40:20 +0800 Subject: [PATCH 09/14] Update taskfiles/deps/README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- taskfiles/deps/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taskfiles/deps/README.md b/taskfiles/deps/README.md index 68babaa7f5..cfea0a13d9 100644 --- a/taskfiles/deps/README.md +++ b/taskfiles/deps/README.md @@ -29,7 +29,7 @@ Apply the following guidelines to the `CMAKE_GEN_ARGS` section of tasks that cal * Build both shared and static libraries when possible. -* Skip unit tests, examples, docs or unused binaries to speed up the installation process. +* Skip unit tests, examples, docs, or unused binaries to speed up the installation process. * Prefer disabling lib-specific testing flags (e.g., `CATCH_BUILD_TESTING=OFF`) rather than setting the generic `BUILD_TESTING` to `OFF`. From 3cfd2730f287648930f0faa7262e9a93de3fce4c Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Sun, 9 Nov 2025 22:42:56 -0500 Subject: [PATCH 10/14] Remove shared libs in task installations --- components/core/CMakeLists.txt | 6 -- .../core/cmake/Modules/FindLibLZMA.cmake | 96 ------------------- taskfiles/deps/main.yaml | 41 +++----- 3 files changed, 11 insertions(+), 132 deletions(-) delete mode 100644 components/core/cmake/Modules/FindLibLZMA.cmake diff --git a/components/core/CMakeLists.txt b/components/core/CMakeLists.txt index 7b5a4ff4c8..46f4141cf9 100644 --- a/components/core/CMakeLists.txt +++ b/components/core/CMakeLists.txt @@ -309,12 +309,6 @@ if(CLP_NEED_ZSTD) endif() if(CLP_NEED_LIBLZMA) - if(CLP_USE_STATIC_LIBS) - set(LibLZMA_ROOT ${LibLZMA-static_ROOT}) - set(LibLZMA_USE_STATIC_LIBS ON) - else() - set(LibLZMA_ROOT ${LibLZMA-shared_ROOT}) - endif() # Version 5.8.1 and above address CVE-2024-3094 and CVE-2025-31115. find_package(LibLZMA 5.8.1 REQUIRED) message(STATUS "Found LibLZMA ${LibLZMA_VERSION}") diff --git a/components/core/cmake/Modules/FindLibLZMA.cmake b/components/core/cmake/Modules/FindLibLZMA.cmake deleted file mode 100644 index 039fa0b249..0000000000 --- a/components/core/cmake/Modules/FindLibLZMA.cmake +++ /dev/null @@ -1,96 +0,0 @@ -# Try to find LibLZMA -# NOTE: The FindLibLZMA.cmake included with CMake has no support for static libraries, so we use our -# own. -# -# Set LibLZMA_USE_STATIC_LIBS=ON to look for static libraries. -# -# Once done, this will define: -# LibLZMA_FOUND - Whether the library was found on the system -# LibLZMA_INCLUDE_DIR - The library include directories -# LibLZMA_LIBRARY - The path to the library file -# LibLZMA_VERSION - The version of the library installed on the system -# -# Conventions: -# - Variables only for use within the script are prefixed with "liblzma_" -# - Variables that should be externally visible are prefixed with "LibLZMA_" - -set(liblzma_HEADER "lzma.h") -set(liblzma_LIBNAME "lzma") -set(liblzma_PKGCONFIG_NAME "liblzma") - -if(DEFINED CLP_DEPS_CPP_DIR) - set(ENV{liblzma_ORIG_PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}") - set(ENV{PKG_CONFIG_PATH} "${CLP_DEPS_CPP_DIR}:$ENV{PKG_CONFIG_PATH}") -endif() - -# Run pkg-config -find_package(PkgConfig) -pkg_check_modules(liblzma_PKGCONF QUIET "${liblzma_PKGCONFIG_NAME}") - -# Set include directory -find_path(LibLZMA_INCLUDE_DIR ${liblzma_HEADER} - HINTS ${liblzma_PKGCONF_INCLUDEDIR} - PATH_SUFFIXES include - ) - -# Handle static libraries -if(LibLZMA_USE_STATIC_LIBS) - set(liblzma_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_STATIC_LIBRARY_SUFFIX}") -endif() - -# Find library -find_library(LibLZMA_LIBRARY - NAMES "${liblzma_LIBNAME}" - HINTS ${liblzma_PKGCONF_LIBDIR} - PATH_SUFFIXES lib - ) - -if(LibLZMA_USE_STATIC_LIBS) - # Restore original value of CMAKE_FIND_LIBRARY_SUFFIXES - set(CMAKE_FIND_LIBRARY_SUFFIXES ${liblzma_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) - unset(liblzma_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES) -endif() - -# Set version -set(LibLZMA_VERSION ${liblzma_PKGCONF_VERSION}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(LibLZMA - REQUIRED_VARS LibLZMA_LIBRARY LibLZMA_INCLUDE_DIR - VERSION_VAR LibLZMA_VERSION - ) - -if(NOT TARGET LibLZMA::LibLZMA) - # Add library to build - if (LibLZMA_USE_STATIC_LIBS) - add_library(LibLZMA::LibLZMA STATIC IMPORTED) - else() - # NOTE: We use UNKNOWN so that if the user doesn't have the SHARED - # libraries installed, we can still use the STATIC libraries - add_library(LibLZMA::LibLZMA UNKNOWN IMPORTED) - endif() - - # Set include directories for library - if(LibLZMA_INCLUDE_DIR) - set_target_properties(LibLZMA::LibLZMA - PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${LibLZMA_INCLUDE_DIR}" - ) - endif() - - # Set location of library - if(EXISTS "${LibLZMA_LIBRARY}") - set_target_properties(LibLZMA::LibLZMA - PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${LibLZMA_LIBRARY}" - ) - endif() -endif() - -# Restore original value of PKG_CONFIG_PATH -if(DEFINED CLP_DEPS_CPP_DIR) - set(ENV{PKG_CONFIG_PATH} "$ENV{liblzma_ORIG_PKG_CONFIG_PATH}") - unset(ENV{liblzma_ORIG_PKG_CONFIG_PATH}) -endif() diff --git a/taskfiles/deps/main.yaml b/taskfiles/deps/main.yaml index 65cda07398..ab99ff0187 100644 --- a/taskfiles/deps/main.yaml +++ b/taskfiles/deps/main.yaml @@ -241,7 +241,6 @@ tasks: - task: "utils:install-remote-cmake-lib" vars: CMAKE_GEN_ARGS: - - "-DBUILD_SHARED_LIBS=ON" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" - "-DFMT_DOC=OFF" @@ -253,38 +252,21 @@ tasks: liblzma: internal: true run: "once" - deps: - - task: "liblzma-install" - vars: - BUILD_SHARED_LIBS: true - - task: "liblzma-install" - vars: - BUILD_SHARED_LIBS: false - - liblzma-install: - internal: true - vars: - LIBLZMA_CMAKE_GEN_ARGS: - - "-DBUILD_TESTING=OFF" - - "-DCMAKE_BUILD_TYPE=Release" - - "-DCMAKE_INSTALL_MESSAGE=LAZY" - - "-DXZ_DOC=OFF" - - "-DXZ_TOOL_LZMADEC=OFF" - - "-DXZ_TOOL_LZMAINFO=OFF" - - "-DXZ_TOOL_SCRIPTS=OFF" - - "-DXZ_TOOL_SYMLINKS_LZMA=OFF" - - "-DXZ_TOOL_XZ=OFF" - - "-DXZ_TOOL_XZDEC=OFF" - requires: - vars: ["BUILD_SHARED_LIBS"] cmds: - task: "utils:install-remote-cmake-lib" vars: CMAKE_GEN_ARGS: - - "-DBUILD_SHARED_LIBS={{ if .BUILD_SHARED_LIBS }}ON{{ else }}OFF{{ end }}" - - >- - {{ join " " .LIBLZMA_CMAKE_GEN_ARGS }} - LIB_NAME: "LibLZMA-{{ if .BUILD_SHARED_LIBS }}shared{{ else }}static{{ end }}" + - "-DBUILD_TESTING=OFF" + - "-DCMAKE_BUILD_TYPE=Release" + - "-DCMAKE_INSTALL_MESSAGE=LAZY" + - "-DXZ_DOC=OFF" + - "-DXZ_TOOL_LZMADEC=OFF" + - "-DXZ_TOOL_LZMAINFO=OFF" + - "-DXZ_TOOL_SCRIPTS=OFF" + - "-DXZ_TOOL_SYMLINKS_LZMA=OFF" + - "-DXZ_TOOL_XZ=OFF" + - "-DXZ_TOOL_XZDEC=OFF" + LIB_NAME: "LibLZMA" TARBALL_SHA256: "507825b599356c10dca1cd720c9d0d0c9d5400b9de300af00e4d1ea150795543" TARBALL_URL: "https://github.com/tukaani-project/xz/releases/download/v5.8.1/\ xz-5.8.1.tar.gz" @@ -449,7 +431,6 @@ tasks: - "-DCMAKE_INSTALL_MESSAGE=LAZY" - "-DCMAKE_POLICY_DEFAULT_CMP0074=NEW" - "-DSPDLOG_BUILD_EXAMPLE=OFF" - - "-DSPDLOG_BUILD_SHARED=ON" - "-DSPDLOG_FMT_EXTERNAL=ON" LIB_NAME: "spdlog" TARBALL_SHA256: "15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67" From 6799f56bfae0a374a9ce4ec8c04e3f69c621f28b Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Mon, 10 Nov 2025 00:35:15 -0500 Subject: [PATCH 11/14] Use static libs for mongocxx and zstd --- components/core/CMakeLists.txt | 12 ++---------- taskfiles/deps/main.yaml | 4 +--- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/components/core/CMakeLists.txt b/components/core/CMakeLists.txt index 46f4141cf9..94f29fea9c 100644 --- a/components/core/CMakeLists.txt +++ b/components/core/CMakeLists.txt @@ -269,11 +269,7 @@ endif() if(CLP_NEED_MONGOCXX) find_package(mongocxx REQUIRED) message(STATUS "Found mongocxx ${mongocxx_VERSION}") - if(CLP_USE_STATIC_LIBS) - set(MONGOCXX_TARGET mongo::mongocxx_static) - else() - set(MONGOCXX_TARGET mongo::mongocxx_shared) - endif() + set(MONGOCXX_TARGET mongo::mongocxx_static) endif() # Find and setup msgpack-cxx @@ -301,11 +297,7 @@ if(CLP_NEED_ZSTD) # v1.4.8 is the lowest version available in the package managers of the OSes we support. find_package(zstd 1.4.8 REQUIRED) message(STATUS "Found zstd ${zstd_VERSION}") - if(CLP_USE_STATIC_LIBS) - set(zstd_TARGET zstd::libzstd_static) - else() - set(zstd_TARGET zstd::libzstd_shared) - endif() + set(zstd_TARGET zstd::libzstd_static) endif() if(CLP_NEED_LIBLZMA) diff --git a/taskfiles/deps/main.yaml b/taskfiles/deps/main.yaml index ab99ff0187..4ce0621017 100644 --- a/taskfiles/deps/main.yaml +++ b/taskfiles/deps/main.yaml @@ -354,7 +354,6 @@ tasks: vars: CMAKE_GEN_ARGS: - "-DBUILD_SHARED_AND_STATIC_LIBS=ON" - - "-DBUILD_SHARED_LIBS_WITH_STATIC_MONGOC=ON" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" - "-DENABLE_EXAMPLES=OFF" @@ -550,8 +549,7 @@ tasks: - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" - "-DZSTD_BUILD_PROGRAMS=OFF" - - "-DZSTD_BUILD_SHARED=ON" - - "-DZSTD_BUILD_STATIC=ON" + - "-DZSTD_BUILD_SHARED=OFF" - "-DZSTD_BUILD_TESTS=OFF" CMAKE_SOURCE_DIR: "build/cmake" LIB_NAME: "zstd" From 19b22efe8e2733398e80cb5d7e80e358306038af Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Mon, 10 Nov 2025 02:35:29 -0500 Subject: [PATCH 12/14] Turn of more shared libs building --- taskfiles/deps/main.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/taskfiles/deps/main.yaml b/taskfiles/deps/main.yaml index 4ce0621017..725d34dc5b 100644 --- a/taskfiles/deps/main.yaml +++ b/taskfiles/deps/main.yaml @@ -169,6 +169,7 @@ tasks: CMAKE_GEN_ARGS: - "-DANTLR4_INSTALL=ON" - "-DANTLR_BUILD_CPP_TESTS=OFF" + - "-DANTLR_BUILD_SHARED=OFF" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" @@ -297,8 +298,7 @@ tasks: - task: "utils:install-remote-cmake-lib" vars: CMAKE_GEN_ARGS: - - "-DBUILD_SHARED_LIBS=ON" - - "-DBUILD_STATIC_LIBS=ON" + - "-DBUILD_SHARED_LIBS=OFF" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" - "-DLZ4_BUILD_CLI=OFF" @@ -408,10 +408,8 @@ tasks: - task: "utils:install-remote-cmake-lib" vars: CMAKE_GEN_ARGS: - - "-DBUILD_SHARED_LIBS=ON" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" - - "-DSIMDJSON_BUILD_STATIC_LIB=ON" LIB_NAME: "simdjson" TARBALL_SHA256: "07a1bb3587aac18fd6a10a83fe4ab09f1100ab39f0cb73baea1317826b9f9e0d" TARBALL_URL: "https://github.com/simdjson/simdjson/archive/refs/tags/v3.13.0.tar.gz" @@ -530,7 +528,6 @@ tasks: - task: "utils:install-remote-cmake-lib" vars: CMAKE_GEN_ARGS: - - "-DBUILD_SHARED_LIBS=ON" - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_MESSAGE=LAZY" - "-DCMAKE_INSTALL_PREFIX={{.G_DEPS_CPP_DIR}}/{{.LIB_NAME}}-install" From 228756022d08ba8584f7688d6385deb9a1c1277f Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Mon, 10 Nov 2025 02:49:49 -0500 Subject: [PATCH 13/14] Update README --- components/core/CMakeLists.txt | 3 ++- taskfiles/deps/README.md | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/components/core/CMakeLists.txt b/components/core/CMakeLists.txt index 94f29fea9c..1189f98eef 100644 --- a/components/core/CMakeLists.txt +++ b/components/core/CMakeLists.txt @@ -297,7 +297,8 @@ if(CLP_NEED_ZSTD) # v1.4.8 is the lowest version available in the package managers of the OSes we support. find_package(zstd 1.4.8 REQUIRED) message(STATUS "Found zstd ${zstd_VERSION}") - set(zstd_TARGET zstd::libzstd_static) + # TODO: replace all occurrences of `zstd_TARGET` with `zstd::libzstd`. + set(zstd_TARGET zstd::libzstd) endif() if(CLP_NEED_LIBLZMA) diff --git a/taskfiles/deps/README.md b/taskfiles/deps/README.md index cfea0a13d9..968792dc94 100644 --- a/taskfiles/deps/README.md +++ b/taskfiles/deps/README.md @@ -2,14 +2,15 @@ Follow the guidelines below when writing or updating dependency installation taskfiles. -* Use one of the following tasks for installation, in descending order of preference: +* Use one of the following tasks for CMake library installation, in descending order of preference: * `deps:utils:install-remote-cmake-lib` * `yscope-dev-utils:cmake:install-remote-tar` -* For special tasks that don't apply to the rule above: +* For special cases where the above tasks are not applicable: + * If the library can be installed via CMake but a custom approach is used, briefly document the + reason. * Include `deps:utils:init` in the `deps` section of the task. - * Briefly explain why if the library is installable via CMake. - * Ensure each library installation includes checksum validation using the best effort. + * Ensure each library installation includes checksum validation to the best extent possible. * Use of `yscope-dev-utils` tasks is encouraged, as most of them include proper checksum checks. * Use `-extracted` as the directory name for tarball extractions. @@ -24,10 +25,16 @@ Apply the following guidelines to the `CMAKE_GEN_ARGS` section of tasks that cal * Set `CMP0074` to `NEW` whenever: * The component's minimum required CMake version is less than 3.27 (where `CMP0074` defaults to - `OLD`) + `OLD`). * The component depends on another via `_ROOT`. -* Build both shared and static libraries when possible. +* Build static-only libraries whenever possible: + * If a library produces both static and shared artifacts by default, disable shared artifact + building to ensure consistent `find_package()` behavior. + * If shared artifacts cannot be disabled, explicitly link CLP targets against the static export + target (e.g., `mongo::mongocxx_static`). + * If a library cannot be statically linked (e.g., MariaDBClient due to GPL licensing), briefly + document the reason. * Skip unit tests, examples, docs, or unused binaries to speed up the installation process. From 3d44c19a41af487da8068bfe1cef033af54971ef Mon Sep 17 00:00:00 2001 From: Bingran Hu Date: Mon, 10 Nov 2025 13:45:51 -0500 Subject: [PATCH 14/14] Minor tweak readme --- taskfiles/deps/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/taskfiles/deps/README.md b/taskfiles/deps/README.md index 968792dc94..c85f7d12e5 100644 --- a/taskfiles/deps/README.md +++ b/taskfiles/deps/README.md @@ -1,14 +1,13 @@ # Dependency Taskfiles -Follow the guidelines below when writing or updating dependency installation taskfiles. +Follow the guidelines below when writing or updating task-based dependency installation files. * Use one of the following tasks for CMake library installation, in descending order of preference: * `deps:utils:install-remote-cmake-lib` * `yscope-dev-utils:cmake:install-remote-tar` * For special cases where the above tasks are not applicable: - * If the library can be installed via CMake but a custom approach is used, briefly document the - reason. + * If the library can be installed via CMake but a custom approach is used, briefly document why. * Include `deps:utils:init` in the `deps` section of the task. * Ensure each library installation includes checksum validation to the best extent possible. * Use of `yscope-dev-utils` tasks is encouraged, as most of them include proper checksum checks.