refactor(vcpkg): standardize vcpkg.json following ecosystem conventions#203
Merged
Conversation
- Change package name from messaging-system to kcenon-messaging-system - Replace direct dependencies with ecosystem packages (common, thread, container) - Move gtest and benchmark to testing feature - Add network, monitoring, database as optional features - Keep ssl feature for TLS support - Remove unnecessary direct dependencies (asio, fmt, spdlog, libpqxx) that should come through ecosystem packages Closes #201
Move kcenon ecosystem packages to optional 'ecosystem' feature to allow CI builds with standard vcpkg packages. This follows the same pattern used in network_system and database_system. Default dependencies now use standard vcpkg packages (asio, fmt, nlohmann-json, spdlog) that are available in the official registry. The ecosystem feature will be enabled once kcenon packages are registered in the vcpkg registry (tracked in common_system#251).
Owner
Author
CI Status NoteThe Windows MSVC build failure is a pre-existing issue in the main branch, not caused by this PR. Evidence:
This PR's CI results:
The vcpkg.json standardization changes have been validated on macOS and in isolated build mode. |
Remove version>= constraints from fmt and openssl dependencies. vcpkg requires builtin-baseline when using version constraints, which causes Windows CI build failures. Using latest available versions instead.
Add --x-feature=testing flag to vcpkg install commands to install gtest and benchmark dependencies that were moved to the testing feature in vcpkg.json.
The gmock feature was removed in vcpkg's gtest port since it is now included by default. Using gtest[gmock] causes build failure: "gtest@1.17.0#2 does not have required feature gmock" This fixes the Windows MSVC CI build failure.
Set VCPKG_MANIFEST_FEATURES before project() to ensure vcpkg installs gtest and benchmark when tests are enabled. This fixes the CMake error: "Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR)" The vcpkg toolchain is loaded during project() call, so manifest features must be configured beforehand.
Reverts the CMakeLists.txt changes from the previous commit. Setting VCPKG_MANIFEST_FEATURES causes CMake to re-run vcpkg install with a different installation path, breaking the build when vcpkg packages were pre-installed by CI to a different directory. The CI workflow already passes --x-feature=testing to vcpkg install, so this configuration is not needed.
Pass VCPKG_INSTALLED_DIR to use pre-installed packages from CI, and VCPKG_MANIFEST_FEATURES to enable the testing feature. This ensures CMake uses the packages installed by the vcpkg install step rather than re-running vcpkg with default features only.
Add 'testing' to vcpkg_installed cache key to ensure cache invalidation when switching between builds with and without testing dependencies. This fixes the GTest not found error on Windows where the cache was created before testing feature was enabled in vcpkg.json.
- Remove VCPKG_INSTALLED_DIR and VCPKG_MANIFEST_FEATURES from Unix build (Unix uses system libraries via apt/brew) - Set VCPKG_MANIFEST_MODE=OFF for Windows to use packages installed by vcpkg install step instead of attempting to reinstall - This fixes the asio.hpp not found error caused by path mismatch between vcpkg install and vcpkg toolchain
Revert VCPKG_MANIFEST_MODE=OFF as it disabled vcpkg toolchain's include path configuration. Use VCPKG_MANIFEST_FEATURES instead to let vcpkg toolchain handle package installation in manifest mode.
Skip manual vcpkg install step on Windows and let vcpkg toolchain install packages in manifest mode. This ensures packages are installed in CMAKE_BINARY_DIR/vcpkg_installed which is the default path vcpkg toolchain uses, avoiding path mismatch issues. vcpkg binary caching is enabled so package installation remains fast.
- Re-enable Windows vcpkg install step (runs on cache miss) - Add VCPKG_INSTALLED_DIR to point CMake to correct package location - Set VCPKG_MANIFEST_MODE=OFF to use pre-installed packages - This ensures vcpkg toolchain finds packages at the cached location
…E=OFF VCPKG_MANIFEST_MODE=OFF disables vcpkg toolchain's include path setup. VCPKG_MANIFEST_INSTALL=OFF keeps manifest mode active but skips auto-install, allowing the toolchain to properly configure include paths for pre-installed packages.
- Remove manual vcpkg install step for Windows - Let vcpkg toolchain handle installation via manifest mode - Use VCPKG_MANIFEST_FEATURES=testing to enable testing dependencies - Windows uses vcpkg binary caching (x-gha) for build speed - Unix continues to use manual vcpkg install with directory caching
network_system links asio as PRIVATE, so asio headers are not propagated to dependent targets. This workaround finds and links asio directly with PUBLIC visibility to ensure asio.hpp is available when compiling network_system headers included by messaging_system.
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.
Summary
Changes
testingfeaturenetworkfeaturemonitoringfeaturedatabasefeatureNew Features Structure
{ "features": { "network": { /* network_system integration */ }, "monitoring": { /* monitoring_system integration */ }, "database": { /* database_system integration */ }, "ssl": { /* TLS/SSL support */ }, "testing": { /* gtest, benchmark */ } } }Test Plan
Notes
Closes #201
Part of kcenon/common_system#251