From afa6bfba1a66fb12a127a3978eb817357e97cf55 Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Mon, 13 Oct 2025 16:58:03 +0000 Subject: [PATCH 01/14] Make use of public vcpkg registry --- vcpkg-configuration.json | 6 +++--- vcpkg.json | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 3c69cc3..9c0fca4 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -7,9 +7,9 @@ "registries": [ { "kind": "git", - "repository": "git@github.com:ccpgames/carbon-vcpkg-registry.git", - "baseline": "4089428d25208720dcf6451cb8b57816bbf9fb9d", - "packages": ["carbon-*", "python3-prebuilt", "bsdiff-drake127"] + "repository": "git@github.com:carbonengine/vcpkg-registry.git", + "baseline": "addd8867a1553f4b7866bb7a36deb84bd59bd1f9", + "packages": ["carbon-*", "python3", "bsdiff-drake127"] } ] } diff --git a/vcpkg.json b/vcpkg.json index a7c7699..ff59c16 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,8 +1,8 @@ { "dependencies": [ { - "name": "python3-prebuilt", - "version>=": "3.12.3#2" + "name": "python3", + "version>=": "3.12.3" }, { From 9dcd64b555f6a74fb20f692681336390d5e28d62 Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Tue, 14 Oct 2025 15:37:11 +0000 Subject: [PATCH 02/14] Add minimum version restriction on vcpkg dependencies --- vcpkg.json | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index ff59c16..0978702 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -4,38 +4,45 @@ "name": "python3", "version>=": "3.12.3" }, - + { "name":"argparse", "version>=":"2.2#0" }, { - "name":"curl" + "name":"curl", + "version>=": "8.11.1#1" }, { - "name":"gtest" + "name":"gtest", + "version>=": "1.15.2" }, { - "name":"cryptopp" + "name":"cryptopp", + "version>=": "8.9.0#1" }, { - "name":"tiny-process-library" + "name":"tiny-process-library", + "version>=": "2.0.4#3" }, { - "name":"yaml-cpp" + "name":"yaml-cpp", + "version>=": "0.8.0#1" }, { - "name":"zlib" + "name":"zlib", + "version>=": "1.3.1" }, { - "name":"bsdiff-drake127" + "name":"bsdiff-drake127", + "version>=": "4.3.3" } ], From 9124c356f4a1cb776c04906fdcabd95fbed2d822 Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Tue, 14 Oct 2025 15:38:18 +0000 Subject: [PATCH 03/14] Re-format vcpkg.json file --- vcpkg.json | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index 0978702..d616e99 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -4,49 +4,43 @@ "name": "python3", "version>=": "3.12.3" }, - { - "name":"argparse", - "version>=":"2.2#0" + "name": "argparse", + "version>=": "2.2#0" }, - { - "name":"curl", + "name": "curl", "version>=": "8.11.1#1" }, - { - "name":"gtest", + "name": "gtest", "version>=": "1.15.2" }, - { - "name":"cryptopp", + "name": "cryptopp", "version>=": "8.9.0#1" }, - { - "name":"tiny-process-library", + "name": "tiny-process-library", "version>=": "2.0.4#3" }, - { - "name":"yaml-cpp", + "name": "yaml-cpp", "version>=": "0.8.0#1" }, - { - "name":"zlib", + "name": "zlib", "version>=": "1.3.1" }, - { - "name":"bsdiff-drake127", + "name": "bsdiff-drake127", "version>=": "4.3.3" } ], - "overrides": [ - { "name": "argparse", "version": "2.2#0" } + { + "name": "argparse", + "version": "2.2#0" + } ] } From 27952bfcadf0af47458da3f820b258a8dc64f118 Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:56:42 +0000 Subject: [PATCH 04/14] Add option for building tests --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 761d00b..be92192 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,9 +104,14 @@ target_include_directories(resources-static add_subdirectory(cli) -enable_testing() - -add_subdirectory(tests) +# Enable testing based on option set (on by default) +if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + option(BUILD_TESTING "Build and run tests. Enabled by default." ON) + include(CTest) + if(BUILD_TESTING) + add_subdirectory(tests) + endif() +endif() # Provide an install target if this is the top level project only From 9e4ea8a52567a6f605ae70143a374b4e2a1237d8 Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Wed, 15 Oct 2025 16:42:54 +0000 Subject: [PATCH 05/14] Add feature support for tests and document generation --- CMakeLists.txt | 20 ++++++++++++++------ vcpkg.json | 36 ++++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index be92192..75f15b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,14 +105,17 @@ target_include_directories(resources-static add_subdirectory(cli) # Enable testing based on option set (on by default) -if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) - option(BUILD_TESTING "Build and run tests. Enabled by default." ON) +if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) + option(BUILD_TESTING "Build and run tests. Enabled by default." OFF) include(CTest) - if(BUILD_TESTING) + if (BUILD_TESTING) + message(STATUS "Running tests is a vcpkg feature and needs to be enabled explicitly, example:") + message(STATUS "\tCMake configure: -DVCPKG_MANIFEST_FEATURES=tests,<...any other features...>") + message(STATUS "\tCMakeUserPresets.json add: \"cacheVariables\": { \"VCPKG_MANIFEST_FEATURES\": \"tests;<...any other features...>\" }") + message(STATUS "\tCommand line: vcpkg install --features=tests,<...any other features...>") add_subdirectory(tests) - endif() -endif() - + endif () +endif () # Provide an install target if this is the top level project only if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) @@ -128,6 +131,11 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) option(BUILD_DOCUMENTATION "Build Documentation" ${BUILD_DOCUMENTATION_DEFAULT_FLAG}) if (BUILD_DOCUMENTATION) + message(STATUS "Generating documentation is a vcpkg feature and needs to be enabled explicitly, example:") + message(STATUS "\tCMake configure: -DVCPKG_MANIFEST_FEATURES=docs,<...any other features...>") + message(STATUS "\tCMakeUserPresets.json add: \"cacheVariables\": { \"VCPKG_MANIFEST_FEATURES\": \"docs;<...any other features...>\" }") + message(STATUS "\tCommand line: vcpkg install --features=docs,<...any other features...>") + # Run sphinx set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/doc/source) set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/doc/build) diff --git a/vcpkg.json b/vcpkg.json index d616e99..3233479 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,9 +1,5 @@ { "dependencies": [ - { - "name": "python3", - "version>=": "3.12.3" - }, { "name": "argparse", "version>=": "2.2#0" @@ -12,18 +8,10 @@ "name": "curl", "version>=": "8.11.1#1" }, - { - "name": "gtest", - "version>=": "1.15.2" - }, { "name": "cryptopp", "version>=": "8.9.0#1" }, - { - "name": "tiny-process-library", - "version>=": "2.0.4#3" - }, { "name": "yaml-cpp", "version>=": "0.8.0#1" @@ -37,6 +25,30 @@ "version>=": "4.3.3" } ], + "features": { + "tests": { + "description": "Dependencies needed for generating and running tests", + "dependencies": [ + { + "name": "gtest", + "version>=": "1.15.2" + }, + { + "name": "tiny-process-library", + "version>=": "2.0.4#3" + } + ] + }, + "docs": { + "description": "Dependencies needed for generating documentation", + "dependencies": [ + { + "name": "python3", + "version>=": "3.12.3" + } + ] + } + }, "overrides": [ { "name": "argparse", From b849f832f28f86ea6bb71ea93632e2f660c43a40 Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Thu, 16 Oct 2025 13:46:10 +0000 Subject: [PATCH 06/14] Remove redundant use of CTest --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75f15b1..af4b904 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,7 +107,6 @@ add_subdirectory(cli) # Enable testing based on option set (on by default) if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) option(BUILD_TESTING "Build and run tests. Enabled by default." OFF) - include(CTest) if (BUILD_TESTING) message(STATUS "Running tests is a vcpkg feature and needs to be enabled explicitly, example:") message(STATUS "\tCMake configure: -DVCPKG_MANIFEST_FEATURES=tests,<...any other features...>") From 3cdeb4537ebc0e311fb0574f7f281b27dd2778ea Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Thu, 16 Oct 2025 14:10:15 +0000 Subject: [PATCH 07/14] Make python and gtest host dependencies --- vcpkg.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index 3233479..32b4152 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -31,7 +31,8 @@ "dependencies": [ { "name": "gtest", - "version>=": "1.15.2" + "version>=": "1.15.2", + "host": true }, { "name": "tiny-process-library", @@ -44,7 +45,8 @@ "dependencies": [ { "name": "python3", - "version>=": "3.12.3" + "version>=": "3.12.3", + "host": true } ] } From 144b89f4b2b33b5f6434df444f7bdc6015a8c30d Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Thu, 16 Oct 2025 14:12:07 +0000 Subject: [PATCH 08/14] Update feature descriptions --- vcpkg.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index 32b4152..fd6e097 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -27,7 +27,7 @@ ], "features": { "tests": { - "description": "Dependencies needed for generating and running tests", + "description": "Enable tests", "dependencies": [ { "name": "gtest", @@ -41,7 +41,7 @@ ] }, "docs": { - "description": "Dependencies needed for generating documentation", + "description": "Generate documentation", "dependencies": [ { "name": "python3", From a47b46843af0bf2fe71ba8e71242fda395464a27 Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Thu, 16 Oct 2025 15:15:04 +0000 Subject: [PATCH 09/14] Remove unnecessary status messages --- CMakeLists.txt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af4b904..9badb71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,10 +108,6 @@ add_subdirectory(cli) if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) option(BUILD_TESTING "Build and run tests. Enabled by default." OFF) if (BUILD_TESTING) - message(STATUS "Running tests is a vcpkg feature and needs to be enabled explicitly, example:") - message(STATUS "\tCMake configure: -DVCPKG_MANIFEST_FEATURES=tests,<...any other features...>") - message(STATUS "\tCMakeUserPresets.json add: \"cacheVariables\": { \"VCPKG_MANIFEST_FEATURES\": \"tests;<...any other features...>\" }") - message(STATUS "\tCommand line: vcpkg install --features=tests,<...any other features...>") add_subdirectory(tests) endif () endif () @@ -130,11 +126,6 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) option(BUILD_DOCUMENTATION "Build Documentation" ${BUILD_DOCUMENTATION_DEFAULT_FLAG}) if (BUILD_DOCUMENTATION) - message(STATUS "Generating documentation is a vcpkg feature and needs to be enabled explicitly, example:") - message(STATUS "\tCMake configure: -DVCPKG_MANIFEST_FEATURES=docs,<...any other features...>") - message(STATUS "\tCMakeUserPresets.json add: \"cacheVariables\": { \"VCPKG_MANIFEST_FEATURES\": \"docs;<...any other features...>\" }") - message(STATUS "\tCommand line: vcpkg install --features=docs,<...any other features...>") - # Run sphinx set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/doc/source) set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/doc/build) From 12229ae21b1bf478ed226e0dc95e0b883521722c Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Thu, 16 Oct 2025 15:44:52 +0000 Subject: [PATCH 10/14] Make Python only needed for doc generation --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9badb71..360cf1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,6 @@ include(cmake/CcpTargetConfigurations.cmake) include(cmake/CcpDocsGenerator.cmake) find_package(yaml-cpp CONFIG REQUIRED) -find_package(Python3 COMPONENTS Interpreter REQUIRED) # Add subdirectory for resource tools static library add_subdirectory(tools) @@ -126,6 +125,8 @@ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) option(BUILD_DOCUMENTATION "Build Documentation" ${BUILD_DOCUMENTATION_DEFAULT_FLAG}) if (BUILD_DOCUMENTATION) + find_package(Python3 COMPONENTS Interpreter REQUIRED) + # Run sphinx set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/doc/source) set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/doc/build) From 7bc120a74deaf2d505138c52811fb1fd5b2a82c7 Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Fri, 17 Oct 2025 15:10:40 +0000 Subject: [PATCH 11/14] Change CMake test settings - Make sure tests are ON by default - Re-introduce CTest --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 360cf1c..c1b5f68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,8 +105,9 @@ add_subdirectory(cli) # Enable testing based on option set (on by default) if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) - option(BUILD_TESTING "Build and run tests. Enabled by default." OFF) + option(BUILD_TESTING "Build and run tests. Enabled by default." ON) if (BUILD_TESTING) + include(CTest) add_subdirectory(tests) endif () endif () From d6c5d6a3d152d8e69687e92d46936288e2bd0f99 Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Fri, 17 Oct 2025 15:13:32 +0000 Subject: [PATCH 12/14] Update vcpkg feature settings - Make tests a default feature - Remove host dependency on gtest and python3 - Introduce a _ci configPreset with tests;docs turned ON --- CMakePresets.json | 21 +++++++++++++++++++++ tests/CMakeLists.txt | 3 +++ vcpkg.json | 9 +++++---- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 521f79f..7012b85 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -58,6 +58,27 @@ "environment": { "X_VCPKG_REGISTRIES_CACHE": "${sourceDir}/vcpkg_registry_cache" } + }, + { + "name": "ci", + "hidden": true, + "cacheVariables": { + "BUILD_DOCUMENTATION": "ON", + "BUILD_TESTING": "ON", + "VCPKG_MANIFEST_FEATURES": "docs;tests" + } + }, + { + "name": "carbon_windows_vcpkg_vs_ci", + "inherits": ["carbon_windows_vcpkg_vs", "ci"] + }, + { + "name": "carbon_windows_vcpkg_nmc_ci", + "inherits": ["carbon_windows_vcpkg_nmc", "ci"] + }, + { + "name": "carbon_osx_vcpkg_ci", + "inherits": ["carbon_osx_vcpkg", "ci"] } ] } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7bf6c1a..62d5e0e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -65,6 +65,9 @@ endif () cmake_path(SET TEST_DATA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/testData) +message(STATUS "=========> Test data path: ${TEST_DATA_PATH}") + + gtest_discover_tests( resources-test capiTests PROPERTIES diff --git a/vcpkg.json b/vcpkg.json index fd6e097..435f4e5 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -25,14 +25,16 @@ "version>=": "4.3.3" } ], + "default-features": [ + "tests" + ], "features": { "tests": { "description": "Enable tests", "dependencies": [ { "name": "gtest", - "version>=": "1.15.2", - "host": true + "version>=": "1.15.2" }, { "name": "tiny-process-library", @@ -45,8 +47,7 @@ "dependencies": [ { "name": "python3", - "version>=": "3.12.3", - "host": true + "version>=": "3.12.3" } ] } From 66ca6c2f33354a33d1020487aaf937151051e888 Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Fri, 17 Oct 2025 15:21:13 +0000 Subject: [PATCH 13/14] Remove debug status message --- tests/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 62d5e0e..7bf6c1a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -65,9 +65,6 @@ endif () cmake_path(SET TEST_DATA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/testData) -message(STATUS "=========> Test data path: ${TEST_DATA_PATH}") - - gtest_discover_tests( resources-test capiTests PROPERTIES From dfa1cd592a73f2f6c99a66990849b7748f48fe4e Mon Sep 17 00:00:00 2001 From: CCP ChargeBack <35330827+ccp-chargeback@users.noreply.github.com> Date: Mon, 20 Oct 2025 11:14:48 +0000 Subject: [PATCH 14/14] Making python and gtest as host dependencies --- CMakePresets.json | 9 ++++++--- vcpkg.json | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 7012b85..6a225c6 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -17,7 +17,8 @@ "cacheVariables": { "CMAKE_COMPILE_WARNING_AS_ERROR": "ON", "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake/triplets", - "VCPKG_TARGET_TRIPLET": "x64-windows-carbon" + "VCPKG_TARGET_TRIPLET": "x64-windows-carbon", + "VCPKG_HOST_TRIPLET": "x64-windows-carbon" }, "environment": { "X_VCPKG_REGISTRIES_CACHE": "${sourceDir}/vcpkg_registry_cache" @@ -31,7 +32,8 @@ "cacheVariables": { "CMAKE_COMPILE_WARNING_AS_ERROR": "ON", "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake/triplets", - "VCPKG_TARGET_TRIPLET": "x64-windows-carbon" + "VCPKG_TARGET_TRIPLET": "x64-windows-carbon", + "VCPKG_HOST_TRIPLET": "x64-windows-carbon" }, "environment": { "X_VCPKG_REGISTRIES_CACHE": "${sourceDir}/vcpkg_registry_cache" @@ -53,7 +55,8 @@ "cacheVariables": { "CMAKE_COMPILE_WARNING_AS_ERROR": "ON", "VCPKG_OVERLAY_TRIPLETS": "${sourceDir}/cmake/triplets", - "VCPKG_TARGET_TRIPLET": "arm64-osx-carbon" + "VCPKG_TARGET_TRIPLET": "arm64-osx-carbon", + "VCPKG_HOST_TRIPLET": "arm64-osx-carbon" }, "environment": { "X_VCPKG_REGISTRIES_CACHE": "${sourceDir}/vcpkg_registry_cache" diff --git a/vcpkg.json b/vcpkg.json index 435f4e5..bb2353a 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -34,11 +34,13 @@ "dependencies": [ { "name": "gtest", - "version>=": "1.15.2" + "version>=": "1.15.2", + "host": true }, { "name": "tiny-process-library", - "version>=": "2.0.4#3" + "version>=": "2.0.4#3", + "host": true } ] }, @@ -47,7 +49,8 @@ "dependencies": [ { "name": "python3", - "version>=": "3.12.3" + "version>=": "3.12.3", + "host": true } ] }