From d472435ac11c0c753f17303116953d741af56ac3 Mon Sep 17 00:00:00 2001 From: ekoby Date: Mon, 17 Mar 2025 11:18:25 -0400 Subject: [PATCH 1/5] update vcpkg baseline to 2025.03.19 updated versions: - [openssl@3.4.1](https://github.com/openssl/openssl/releases/tag/openssl-3.4.1) - [libuv@1.50.0](https://github.com/libuv/libuv/releases/tag/v1.50.0) - [protobuf-c@v1.5.1](https://github.com/protobuf-c/protobuf-c/releases/tag/v1.5.1) - [json-c@v0.18-20240915](https://github.com/json-c/json-c/releases/tag/json-c-0.18-20240915) --- vcpkg.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 57d6b377..7ea55a4e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -38,5 +38,5 @@ ] } }, - "builtin-baseline": "b322364f06308bdd24823f9d8f03fe0cc86fd46f" + "builtin-baseline": "b02e341c927f16d991edbd915d8ea43eac52096c" } From 036cf443ec776369ef92760144f7e5398fd959d0 Mon Sep 17 00:00:00 2001 From: ekoby Date: Mon, 24 Mar 2025 14:02:37 -0400 Subject: [PATCH 2/5] try protobuf overlay override --- vcpkg-configuration.json | 3 +++ vcpkg-overlays/protobuf/portfile.cmake | 1 + vcpkg-overlays/protobuf/vcpkg.json | 4 ++++ 3 files changed, 8 insertions(+) create mode 100644 vcpkg-configuration.json create mode 100644 vcpkg-overlays/protobuf/portfile.cmake create mode 100644 vcpkg-overlays/protobuf/vcpkg.json diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json new file mode 100644 index 00000000..7903c735 --- /dev/null +++ b/vcpkg-configuration.json @@ -0,0 +1,3 @@ +{ + "overlay-ports": ["../vckpg-overlay" ] +} \ No newline at end of file diff --git a/vcpkg-overlays/protobuf/portfile.cmake b/vcpkg-overlays/protobuf/portfile.cmake new file mode 100644 index 00000000..0015715f --- /dev/null +++ b/vcpkg-overlays/protobuf/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/vcpkg-overlays/protobuf/vcpkg.json b/vcpkg-overlays/protobuf/vcpkg.json new file mode 100644 index 00000000..21883c4e --- /dev/null +++ b/vcpkg-overlays/protobuf/vcpkg.json @@ -0,0 +1,4 @@ +{ + "name": "protobuf", + "version": "0" +} From 4c3a5c33bacdc39ce21a7c5d69b48322247f5220 Mon Sep 17 00:00:00 2001 From: ekoby Date: Mon, 24 Mar 2025 14:04:49 -0400 Subject: [PATCH 3/5] try protobuf overlay override --- vcpkg-configuration.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 7903c735..fb3c4c3e 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -1,3 +1,4 @@ { - "overlay-ports": ["../vckpg-overlay" ] + "overlay-ports": ["../vckpg-overlay" ], + "baseline": "b02e341c927f16d991edbd915d8ea43eac52096c" } \ No newline at end of file From b93e5a8956e104580f31d10c708036fe66ab7eda Mon Sep 17 00:00:00 2001 From: ekoby Date: Mon, 24 Mar 2025 14:30:43 -0400 Subject: [PATCH 4/5] add custom protobuf-c overlay to avoid the long protobuf build --- vcpkg-configuration.json | 2 +- .../protobuf-c/fix-crt-linkage.patch | 25 ++++++++++ .../protobuf-c/fix-dependency-protobuf.patch | 13 +++++ vcpkg-overlays/protobuf-c/portfile.cmake | 48 +++++++++++++++++++ vcpkg-overlays/protobuf-c/vcpkg.json | 33 +++++++++++++ vcpkg-overlays/protobuf/portfile.cmake | 1 - vcpkg-overlays/protobuf/vcpkg.json | 4 -- 7 files changed, 120 insertions(+), 6 deletions(-) create mode 100644 vcpkg-overlays/protobuf-c/fix-crt-linkage.patch create mode 100644 vcpkg-overlays/protobuf-c/fix-dependency-protobuf.patch create mode 100644 vcpkg-overlays/protobuf-c/portfile.cmake create mode 100644 vcpkg-overlays/protobuf-c/vcpkg.json delete mode 100644 vcpkg-overlays/protobuf/portfile.cmake delete mode 100644 vcpkg-overlays/protobuf/vcpkg.json diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index fb3c4c3e..727130fd 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -1,4 +1,4 @@ { - "overlay-ports": ["../vckpg-overlay" ], + "overlay-ports": ["./vcpkg-overlays" ], "baseline": "b02e341c927f16d991edbd915d8ea43eac52096c" } \ No newline at end of file diff --git a/vcpkg-overlays/protobuf-c/fix-crt-linkage.patch b/vcpkg-overlays/protobuf-c/fix-crt-linkage.patch new file mode 100644 index 00000000..2d674426 --- /dev/null +++ b/vcpkg-overlays/protobuf-c/fix-crt-linkage.patch @@ -0,0 +1,25 @@ +diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt +index 98b51eb..0243b80 100644 +--- a/build-cmake/CMakeLists.txt ++++ b/build-cmake/CMakeLists.txt +@@ -74,11 +74,6 @@ if(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4267 /wd4244") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4267 /wd4244") + +- # Allow matching protobuf runtime dependency +- if(NOT BUILD_SHARED_LIBS) +- set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") +- endif(NOT BUILD_SHARED_LIBS) +- + endif() + + get_filename_component(MAIN_DIR ${CMAKE_CURRENT_SOURCE_DIR} PATH) +@@ -103,7 +98,7 @@ if(BUILD_PROTOC) + include_directories(${CMAKE_CURRENT_BINARY_DIR}) # for generated files + endif() + +-if(MSVC AND NOT BUILD_SHARED_LIBS) ++if (0) + # In case we are building static libraries, link also the runtime library + # statically so that MSVCR*.DLL is not required at runtime. + # https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx This is achieved by diff --git a/vcpkg-overlays/protobuf-c/fix-dependency-protobuf.patch b/vcpkg-overlays/protobuf-c/fix-dependency-protobuf.patch new file mode 100644 index 00000000..3fd8c7aa --- /dev/null +++ b/vcpkg-overlays/protobuf-c/fix-dependency-protobuf.patch @@ -0,0 +1,13 @@ +diff --git a/build-cmake/CMakeLists.txt b/build-cmake/CMakeLists.txt +index ba0b730..a5161cf 100644 +--- a/build-cmake/CMakeLists.txt ++++ b/build-cmake/CMakeLists.txt +@@ -15,7 +15,7 @@ if(MSVC AND NOT BUILD_SHARED_LIBS) + set(Protobuf_USE_STATIC_LIBS ON) + endif() + +-find_package(Protobuf CONFIG) ++find_package(Protobuf CONFIG) + if(Protobuf_FOUND) + # Keep compatibility with FindProtobuf CMake module + set(PROTOBUF_PROTOC_EXECUTABLE $) diff --git a/vcpkg-overlays/protobuf-c/portfile.cmake b/vcpkg-overlays/protobuf-c/portfile.cmake new file mode 100644 index 00000000..3bcf223f --- /dev/null +++ b/vcpkg-overlays/protobuf-c/portfile.cmake @@ -0,0 +1,48 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO protobuf-c/protobuf-c + REF v${VERSION} + SHA512 009b8f45aade52cccf3177de88a5357c72b1626b8d07acee17da5ad1ed0e9f6a2e24d921e673b14323331e3b25fe2556f49b437d5e071e77c385efdd72ea5fe3 + HEAD_REF master + PATCHES + fix-crt-linkage.patch + fix-dependency-protobuf.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + tools BUILD_PROTOC + test BUILD_TESTS +) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}/build-cmake" + DISABLE_PARALLEL_CONFIGURE + OPTIONS ${FEATURE_OPTIONS} +) + +vcpkg_cmake_install(ADD_BIN_TO_PATH) +vcpkg_fixup_pkgconfig() +vcpkg_copy_pdbs() + +if("tools" IN_LIST FEATURES) + vcpkg_copy_tools( + TOOL_NAMES protoc-gen-c + AUTO_CLEAN + ) +endif() + +vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/protobuf-c") + +# Include files should not be duplicated into the /debug/include directory. +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +# Remove duplicate PDB files (vcpkg_copy_pdbs already copied them to "bin") +file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/protobuf-c.pdb") +file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/protobuf-c.pdb") +if(NOT VCPKG_TARGET_IS_WINDOWS) + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() + +# Handle copyright +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg-overlays/protobuf-c/vcpkg.json b/vcpkg-overlays/protobuf-c/vcpkg.json new file mode 100644 index 00000000..35067ddd --- /dev/null +++ b/vcpkg-overlays/protobuf-c/vcpkg.json @@ -0,0 +1,33 @@ +{ + "name": "protobuf-c", + "version-semver": "1.5.1", + "description": "This is protobuf-c, a C implementation of the Google Protocol Buffers data serialization format.", + "homepage": "https://github.com/protobuf-c/protobuf-c", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "test": { + "description": "Build test project.", + "dependencies": [ + { + "name": "protobuf-c", + "features": [ + "tools" + ] + } + ] + }, + "tools": { + "description": "Build tools (protoc-gen-c).", + "supports": "!uwp" + } + } +} diff --git a/vcpkg-overlays/protobuf/portfile.cmake b/vcpkg-overlays/protobuf/portfile.cmake deleted file mode 100644 index 0015715f..00000000 --- a/vcpkg-overlays/protobuf/portfile.cmake +++ /dev/null @@ -1 +0,0 @@ -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) \ No newline at end of file diff --git a/vcpkg-overlays/protobuf/vcpkg.json b/vcpkg-overlays/protobuf/vcpkg.json deleted file mode 100644 index 21883c4e..00000000 --- a/vcpkg-overlays/protobuf/vcpkg.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "protobuf", - "version": "0" -} From c26a33bd90459fdcd4267c7a1802e7f141cbd373 Mon Sep 17 00:00:00 2001 From: ekoby Date: Mon, 24 Mar 2025 14:33:43 -0400 Subject: [PATCH 5/5] add custom protobuf-c overlay to avoid the long protobuf build --- .github/actions/build/action.yml | 3 +++ vcpkg-configuration.json | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index c0068299..545416ad 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -48,6 +48,9 @@ runs: - uses: lukka/get-cmake@v3.30.1 - uses: lukka/run-vcpkg@v11 + with: + vcpkgJsonGlob: './vcpkg.json' + - uses: actions/cache@v4 with: diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index 727130fd..d21b3b5f 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -1,4 +1,3 @@ { - "overlay-ports": ["./vcpkg-overlays" ], - "baseline": "b02e341c927f16d991edbd915d8ea43eac52096c" + "overlay-ports": ["./vcpkg-overlays" ] } \ No newline at end of file