diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 90b6d91..7263588 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -1,8 +1,16 @@ # keep this without major version to let the bot pick it up -{% set version = "25.3" %} +{% set version = "26.0" %} # protobuf doesn't add the major version in the tag, it's defined per language in # https://github.com/protocolbuffers/protobuf/blob/main/version.json -{% set major = "4" %} +{% set major = "5" %} +# pkg-config metadata sets yet another version format, not using the major version +# but adding the rc number as a patch version, or 0 for regular releases +{% set pkgconfig_ver = version.split(".")[0] ~ "." ~ version.split(".")[1] %} +{% if version.split(".")[-1].startswith("rc") %} + {% set pkgconfig_ver = pkgconfig_ver ~ "." ~ version.split(".")[-1].replace("rc", "") %} +{% else %} + {% set pkgconfig_ver = pkgconfig_ver ~ "." ~ "0" %} +{% endif %} {% set libraries = ["libprotoc", "libprotobuf", "libprotobuf-lite"] %} @@ -12,7 +20,7 @@ package: source: - url: https://github.com/protocolbuffers/protobuf/archive/refs/tags/v{{ version.replace(".rc", "-rc") }}.tar.gz - sha256: d19643d265b978383352b3143f04c0641eea75a75235c111cc01a1350173180e + sha256: e32100a8013870d24ffc37dad6781a61e5d0c99501bcb04d39c340a1c44a8e63 patches: - patches/0001-use-consistent-cmake-location.patch - patches/0002-set-static-lib-extension-on-windows.patch @@ -20,15 +28,13 @@ source: # grpc_cpp_java_plugin links against otherwise internal symbols - patches/0004-Export-functions-in-google-compiler-java-names.patch - patches/0005-do-not-install-vendored-gmock.patch - # backport https://github.com/protocolbuffers/protobuf/pull/15518 - - patches/0006-Fix-getting-env-variables-on-windows.patch - # backport https://github.com/protocolbuffers/protobuf/commit/f78f9c51fa2470070e5d4b49649800971c789224 - - patches/0007-Workaround-false-positive-warning-in-MSVC.-Fixes-htt.patch # backport https://github.com/protocolbuffers/protobuf/pull/15888 - - patches/0008-fix-pkg-config-metadata-for-shared-abseil-on-windows.patch + - patches/0006-fix-pkg-config-metadata-for-shared-abseil-on-windows.patch # skip annoyingly flaky test on windows, see # https://github.com/protocolbuffers/protobuf/issues/8645 - - patches/0009-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch # [win] + - patches/0007-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch # [win] + # backport https://github.com/protocolbuffers/protobuf/pull/16231 + - patches/0008-Fix-windows-only-issue-in-our-compiler-unittests.patch build: number: 0 @@ -94,8 +100,8 @@ outputs: - if not exist %LIBRARY_LIB%\cmake\protobuf\protobuf-config.cmake exit 1 # [win] # pkg-config - - pkg-config --print-errors --exact-version "{{ version }}.0" protobuf - - pkg-config --print-errors --exact-version "{{ version }}.0" protobuf-lite + - pkg-config --print-errors --exact-version "{{ pkgconfig_ver }}" protobuf + - pkg-config --print-errors --exact-version "{{ pkgconfig_ver }}" protobuf-lite # binary - protoc --help diff --git a/recipe/patches/0001-use-consistent-cmake-location.patch b/recipe/patches/0001-use-consistent-cmake-location.patch index 15d59ac..0221f95 100644 --- a/recipe/patches/0001-use-consistent-cmake-location.patch +++ b/recipe/patches/0001-use-consistent-cmake-location.patch @@ -1,17 +1,17 @@ -From df4354948bbcf18e6a41fc5743724fe85b166bc2 Mon Sep 17 00:00:00 2001 +From d8881312b1307f5b4c4c2576e3512e68290af874 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 3 Sep 2022 19:48:04 +0200 -Subject: [PATCH 1/9] use consistent cmake location +Subject: [PATCH 1/8] use consistent cmake location --- cmake/install.cmake | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/cmake/install.cmake b/cmake/install.cmake -index 9679d5b26..c4757f06c 100644 +index 52914a8ea..5d89a5f5f 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake -@@ -96,15 +96,9 @@ set(_install_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the c +@@ -98,15 +98,9 @@ set(_install_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the c set(_build_cmakedir_desc "Directory relative to CMAKE_CURRENT_BINARY_DIR for cmake configuration files") set(_exampledir_desc "Directory relative to CMAKE_INSTALL_DATA to install examples") set(_protobuf_subdir_desc "Subdirectory in which to install cmake configuration files") diff --git a/recipe/patches/0002-set-static-lib-extension-on-windows.patch b/recipe/patches/0002-set-static-lib-extension-on-windows.patch index 9281ff3..f40faa8 100644 --- a/recipe/patches/0002-set-static-lib-extension-on-windows.patch +++ b/recipe/patches/0002-set-static-lib-extension-on-windows.patch @@ -1,17 +1,17 @@ -From 6137fefd543de0aca634ef820f83f7e9d6e6f075 Mon Sep 17 00:00:00 2001 +From 22e5509651b5e084698703390063abeae73a6b9f Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 4 Sep 2022 10:57:08 +0200 -Subject: [PATCH 2/9] set static lib extension on windows +Subject: [PATCH 2/8] set static lib extension on windows --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index 162fb1c72..1f175c416 100644 +index 06906417a..b6383b767 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -326,6 +326,12 @@ else () +@@ -328,6 +328,12 @@ else () endif () endif () diff --git a/recipe/patches/0003-always-look-for-shared-abseil-builds.patch b/recipe/patches/0003-always-look-for-shared-abseil-builds.patch index a5a9380..c718bab 100644 --- a/recipe/patches/0003-always-look-for-shared-abseil-builds.patch +++ b/recipe/patches/0003-always-look-for-shared-abseil-builds.patch @@ -1,14 +1,14 @@ -From ce158be9e2ae9baed2a31ed978c2f33c567c01c4 Mon Sep 17 00:00:00 2001 +From 76e73d4d94848a13bfef089dfc505e2ad0263444 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sat, 13 May 2023 22:43:45 +1100 -Subject: [PATCH 3/9] always look for shared abseil builds +Subject: [PATCH 3/8] always look for shared abseil builds --- cmake/abseil-cpp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/abseil-cpp.cmake b/cmake/abseil-cpp.cmake -index b50fb89e6..b07e63f26 100644 +index a4e9d2295..b3ad53528 100644 --- a/cmake/abseil-cpp.cmake +++ b/cmake/abseil-cpp.cmake @@ -37,7 +37,7 @@ elseif(protobuf_ABSL_PROVIDER STREQUAL "package") diff --git a/recipe/patches/0004-Export-functions-in-google-compiler-java-names.patch b/recipe/patches/0004-Export-functions-in-google-compiler-java-names.patch index cc22f7a..4ecf6bd 100644 --- a/recipe/patches/0004-Export-functions-in-google-compiler-java-names.patch +++ b/recipe/patches/0004-Export-functions-in-google-compiler-java-names.patch @@ -1,7 +1,7 @@ -From b4ad926042037d3f40604bf7fa617f49cb426399 Mon Sep 17 00:00:00 2001 +From 0d41978988135d0c3d1000740cd16ddc3ef0e143 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Wed, 14 Jun 2023 11:36:55 +0200 -Subject: [PATCH 4/9] Export functions in google::compiler::java::names +Subject: [PATCH 4/8] Export functions in google::compiler::java::names --- src/google/protobuf/compiler/java/names.h | 20 ++++++++++---------- diff --git a/recipe/patches/0005-do-not-install-vendored-gmock.patch b/recipe/patches/0005-do-not-install-vendored-gmock.patch index 96b9eac..7557e32 100644 --- a/recipe/patches/0005-do-not-install-vendored-gmock.patch +++ b/recipe/patches/0005-do-not-install-vendored-gmock.patch @@ -1,17 +1,17 @@ -From 8e04212bac883743aea9e19e77976f44ffdb5ad6 Mon Sep 17 00:00:00 2001 +From 1fa22abd2038cd9d40648f5fe9faca8490b6e045 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Wed, 9 Aug 2023 14:06:35 +1100 -Subject: [PATCH 5/9] do not install vendored gmock +Subject: [PATCH 5/8] do not install vendored gmock --- cmake/install.cmake | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cmake/install.cmake b/cmake/install.cmake -index c4757f06c..f68ec217b 100644 +index 5d89a5f5f..b516cbab2 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake -@@ -136,10 +136,3 @@ if(protobuf_INSTALL_EXAMPLES) +@@ -138,10 +138,3 @@ if(protobuf_INSTALL_EXAMPLES) DESTINATION "${CMAKE_INSTALL_EXAMPLEDIR}" COMPONENT protobuf-examples) endif() diff --git a/recipe/patches/0006-Fix-getting-env-variables-on-windows.patch b/recipe/patches/0006-Fix-getting-env-variables-on-windows.patch deleted file mode 100644 index 6efb996..0000000 --- a/recipe/patches/0006-Fix-getting-env-variables-on-windows.patch +++ /dev/null @@ -1,28 +0,0 @@ -From ceff6146f5e57b38dd4bd3e66b4798721f57179c Mon Sep 17 00:00:00 2001 -From: Isuru Fernando -Date: Fri, 19 Jan 2024 19:14:50 -0600 -Subject: [PATCH 6/9] Fix getting env variables on windows - ---- - src/google/protobuf/compiler/mock_code_generator.cc | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/src/google/protobuf/compiler/mock_code_generator.cc b/src/google/protobuf/compiler/mock_code_generator.cc -index d7057a1e6..736e895bf 100644 ---- a/src/google/protobuf/compiler/mock_code_generator.cc -+++ b/src/google/protobuf/compiler/mock_code_generator.cc -@@ -73,7 +73,13 @@ static constexpr absl::string_view kSecondInsertionPoint = - " # @@protoc_insertion_point(second_mock_insertion_point) is here\n"; - - MockCodeGenerator::MockCodeGenerator(absl::string_view name) : name_(name) { -- absl::string_view key = getenv("TEST_CASE"); -+ const char* c_key = getenv("TEST_CASE"); -+ if (c_key == NULL) { -+ // In Windows, setting 'TEST_CASE=' is equivalent to unsetting -+ // and therefore c_key can be NULL -+ c_key = ""; -+ } -+ absl::string_view key(c_key); - if (key == "no_editions") { - suppressed_features_ |= CodeGenerator::FEATURE_SUPPORTS_EDITIONS; - } else if (key == "invalid_features") { diff --git a/recipe/patches/0008-fix-pkg-config-metadata-for-shared-abseil-on-windows.patch b/recipe/patches/0006-fix-pkg-config-metadata-for-shared-abseil-on-windows.patch similarity index 84% rename from recipe/patches/0008-fix-pkg-config-metadata-for-shared-abseil-on-windows.patch rename to recipe/patches/0006-fix-pkg-config-metadata-for-shared-abseil-on-windows.patch index 44b7a1c..b9efb85 100644 --- a/recipe/patches/0008-fix-pkg-config-metadata-for-shared-abseil-on-windows.patch +++ b/recipe/patches/0006-fix-pkg-config-metadata-for-shared-abseil-on-windows.patch @@ -1,14 +1,14 @@ -From c0759889e6f5a9899532e54bde8232564a1ff8dc Mon Sep 17 00:00:00 2001 +From 569c7cc8c2def75473921b883682da1f33269d8d Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 20 Feb 2024 20:27:36 +1100 -Subject: [PATCH 8/9] fix pkg-config metadata for shared abseil on windows +Subject: [PATCH 6/8] fix pkg-config metadata for shared abseil on windows --- cmake/install.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/install.cmake b/cmake/install.cmake -index f68ec217b..60871aab9 100644 +index b516cbab2..ee772b461 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake @@ -1,7 +1,10 @@ diff --git a/recipe/patches/0007-Workaround-false-positive-warning-in-MSVC.-Fixes-htt.patch b/recipe/patches/0007-Workaround-false-positive-warning-in-MSVC.-Fixes-htt.patch deleted file mode 100644 index 6e19ab9..0000000 --- a/recipe/patches/0007-Workaround-false-positive-warning-in-MSVC.-Fixes-htt.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 96948fa966e91df3fe6b4a788152b0b83c2ca9b6 Mon Sep 17 00:00:00 2001 -From: Protobuf Team Bot -Date: Thu, 2 Nov 2023 09:13:31 -0700 -Subject: [PATCH 7/9] Workaround false positive warning in MSVC. Fixes - https://github.com/protocolbuffers/protobuf/issues/14602 - -PiperOrigin-RevId: 578875053 ---- - src/google/protobuf/map_field.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/google/protobuf/map_field.h b/src/google/protobuf/map_field.h -index 8aa9e45fe..8388f8a2e 100644 ---- a/src/google/protobuf/map_field.h -+++ b/src/google/protobuf/map_field.h -@@ -678,7 +678,7 @@ class MapField final : public TypeDefinedMapFieldBase { - template --constexpr MapFieldBase::VTable -+PROTOBUF_CONSTINIT const MapFieldBase::VTable - MapField::kVTable = - MapField::template MakeVTable(); - diff --git a/recipe/patches/0009-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch b/recipe/patches/0007-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch similarity index 76% rename from recipe/patches/0009-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch rename to recipe/patches/0007-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch index 90176d7..9abf44e 100644 --- a/recipe/patches/0009-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch +++ b/recipe/patches/0007-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch @@ -1,7 +1,7 @@ -From 02bcda9d01dd12ecf641dba54e0832a97de989f5 Mon Sep 17 00:00:00 2001 +From a43d86c561c6094f02d5e3b5a1b8d14539cd32fa Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Tue, 20 Feb 2024 22:21:55 +1100 -Subject: [PATCH 9/9] disable MapImplTest.RandomOrdering due to flakiness +Subject: [PATCH 7/8] disable MapImplTest.RandomOrdering due to flakiness see https://google.github.io/googletest/advanced.html#temporarily-disabling-tests --- @@ -9,10 +9,10 @@ see https://google.github.io/googletest/advanced.html#temporarily-disabling-test 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/google/protobuf/map_test.inc b/src/google/protobuf/map_test.inc -index c1b002987..34d45f44d 100644 +index cbd0f4461..2a58cc92a 100644 --- a/src/google/protobuf/map_test.inc +++ b/src/google/protobuf/map_test.inc -@@ -1344,7 +1344,7 @@ bool MapOrderingIsRandom(int a, int b) { +@@ -1349,7 +1349,7 @@ bool MapOrderingIsRandom(int a, int b) { // This test verifies that the iteration order is reasonably random even for // small maps. diff --git a/recipe/patches/0008-Fix-windows-only-issue-in-our-compiler-unittests.patch b/recipe/patches/0008-Fix-windows-only-issue-in-our-compiler-unittests.patch new file mode 100644 index 0000000..192aa36 --- /dev/null +++ b/recipe/patches/0008-Fix-windows-only-issue-in-our-compiler-unittests.patch @@ -0,0 +1,58 @@ +From a4ad52b7abda09ec071145cb7253cc1993899295 Mon Sep 17 00:00:00 2001 +From: Mike Kruskal +Date: Tue, 19 Mar 2024 14:47:35 -0700 +Subject: [PATCH 8/8] Fix windows-only issue in our compiler unittests. + +Closes https://github.com/protocolbuffers/protobuf/issues/16026 + +PiperOrigin-RevId: 617301270 +--- + .../protobuf/compiler/mock_code_generator.cc | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/src/google/protobuf/compiler/mock_code_generator.cc b/src/google/protobuf/compiler/mock_code_generator.cc +index 665262d71..7c8912631 100644 +--- a/src/google/protobuf/compiler/mock_code_generator.cc ++++ b/src/google/protobuf/compiler/mock_code_generator.cc +@@ -50,6 +50,7 @@ + namespace google { + namespace protobuf { + namespace compiler { ++namespace { + + // Returns the list of the names of files in all_files in the form of a + // comma-separated string. +@@ -71,14 +72,20 @@ static constexpr absl::string_view kFirstInsertionPoint = + static constexpr absl::string_view kSecondInsertionPoint = + " # @@protoc_insertion_point(second_mock_insertion_point) is here\n"; + +-MockCodeGenerator::MockCodeGenerator(absl::string_view name) : name_(name) { ++absl::string_view GetTestCase() { + const char* c_key = getenv("TEST_CASE"); + if (c_key == NULL) { + // In Windows, setting 'TEST_CASE=' is equivalent to unsetting +- // and therefore c_key can be NULL +- c_key = ""; ++ // and therefore c_key can be nullptr ++ return ""; + } +- absl::string_view key(c_key); ++ return c_key; ++} ++ ++} // namespace ++ ++MockCodeGenerator::MockCodeGenerator(absl::string_view name) : name_(name) { ++ absl::string_view key = GetTestCase(); + if (key == "no_editions") { + suppressed_features_ |= CodeGenerator::FEATURE_SUPPORTS_EDITIONS; + } else if (key == "invalid_features") { +@@ -214,7 +221,7 @@ bool MockCodeGenerator::Generate(const FileDescriptor* file, + std::string* error) const { + // Override minimum/maximum after generating the pool to simulate a plugin + // that "works" but doesn't advertise support of the current edition. +- absl::string_view test_case = getenv("TEST_CASE"); ++ absl::string_view test_case = GetTestCase(); + if (test_case == "high_minimum") { + minimum_edition_ = Edition::EDITION_99997_TEST_ONLY; + } else if (test_case == "low_maximum") {