Skip to content

Commit

Permalink
Merge pull request #236 from xhochy/expose-grpc-java-functions
Browse files Browse the repository at this point in the history
Expose missing symbols for grpc_java_plugin
  • Loading branch information
xhochy authored Sep 27, 2024
2 parents dcc77e6 + 49802b4 commit 046608c
Show file tree
Hide file tree
Showing 7 changed files with 122 additions and 23 deletions.
7 changes: 4 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ source:
- patches/0002-set-static-lib-extension-on-windows.patch
- patches/0003-always-look-for-shared-abseil-builds.patch
# grpc_cpp_java_plugin links against otherwise internal symbols
- patches/0004-do-not-install-vendored-gmock.patch
- patches/0004-Export-functions-in-google-compiler-java-names.patch
- patches/0005-do-not-install-vendored-gmock.patch
# skip annoyingly flaky test on windows, see
# https://github.com/protocolbuffers/protobuf/issues/8645
- patches/0005-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch # [win]
- patches/0006-disable-MapImplTest.RandomOrdering-due-to-flakiness.patch # [win]

build:
number: 1
number: 2

outputs:
- name: libprotobuf
Expand Down
8 changes: 4 additions & 4 deletions recipe/patches/0001-use-consistent-cmake-location.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From d8881312b1307f5b4c4c2576e3512e68290af874 Mon Sep 17 00:00:00 2001
From ac7b92985c7dd93f5ebe7819c6ff9b791bb4f530 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Sat, 3 Sep 2022 19:48:04 +0200
Subject: [PATCH 1/5] use consistent cmake location
Subject: [PATCH 1/6] 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 52914a8ea..5d89a5f5f 100644
index 676d702..65765ca 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -98,15 +98,9 @@ set(_install_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the c
@@ -122,15 +122,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")
Expand Down
8 changes: 4 additions & 4 deletions recipe/patches/0002-set-static-lib-extension-on-windows.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From 22e5509651b5e084698703390063abeae73a6b9f Mon Sep 17 00:00:00 2001
From a629ae7b73682fbaea118129a7635975c70eb6dd Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Sun, 4 Sep 2022 10:57:08 +0200
Subject: [PATCH 2/5] set static lib extension on windows
Subject: [PATCH 2/6] set static lib extension on windows

---
CMakeLists.txt | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06906417a..b6383b767 100644
index 5a4e678..75b0536 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -328,6 +328,12 @@ else ()
@@ -339,6 +339,12 @@ else ()
endif ()
endif ()

Expand Down
10 changes: 5 additions & 5 deletions recipe/patches/0003-always-look-for-shared-abseil-builds.patch
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 76e73d4d94848a13bfef089dfc505e2ad0263444 Mon Sep 17 00:00:00 2001
From ce5bee54d8f6cb52ac550c6e06828912afd79561 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Sat, 13 May 2023 22:43:45 +1100
Subject: [PATCH 3/5] always look for shared abseil builds
Subject: [PATCH 3/6] 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 a4e9d2295..b3ad53528 100644
index 1b64aff..cced07e 100644
--- a/cmake/abseil-cpp.cmake
+++ b/cmake/abseil-cpp.cmake
@@ -37,7 +37,7 @@ elseif(protobuf_ABSL_PROVIDER STREQUAL "package")
Expand All @@ -18,5 +18,5 @@ index a4e9d2295..b3ad53528 100644
-if (BUILD_SHARED_LIBS AND MSVC)
+if (MSVC)
# On MSVC Abseil is bundled into a single DLL.
# This condition is necessary as of abseil 20230125.3 when abseil is consumed via add_subdirectory,
# the abseil_dll target is named abseil_dll, while if abseil is consumed via find_package, the target
# This condition is necessary as of abseil 20230125.3 when abseil is consumed
# via add_subdirectory, the abseil_dll target is named abseil_dll, while if
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
From 06d16c4022e1dab98eca5f36b643946b4c866aef Mon Sep 17 00:00:00 2001
From: "Uwe L. Korn" <[email protected]>
Date: Wed, 14 Jun 2023 11:36:55 +0200
Subject: [PATCH 4/6] Export functions in google::compiler::java::names

---
src/google/protobuf/compiler/java/names.h | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/google/protobuf/compiler/java/names.h b/src/google/protobuf/compiler/java/names.h
index d6402fc..a4e89dd 100644
--- a/src/google/protobuf/compiler/java/names.h
+++ b/src/google/protobuf/compiler/java/names.h
@@ -41,73 +41,73 @@ namespace java {
//
// Returns:
// The fully-qualified Java class name.
-std::string ClassName(const Descriptor* descriptor);
+PROTOC_EXPORT std::string ClassName(const Descriptor* descriptor);

// Requires:
// descriptor != NULL
//
// Returns:
// The fully-qualified Java class name.
-std::string ClassName(const EnumDescriptor* descriptor);
+PROTOC_EXPORT std::string ClassName(const EnumDescriptor* descriptor);

// Requires:
// descriptor != NULL
//
// Returns:
// The fully-qualified Java class name.
-std::string ClassName(const FileDescriptor* descriptor);
+PROTOC_EXPORT std::string ClassName(const FileDescriptor* descriptor);

// Requires:
// descriptor != NULL
//
// Returns:
// The fully-qualified Java class name.
-std::string ClassName(const ServiceDescriptor* descriptor);
+PROTOC_EXPORT std::string ClassName(const ServiceDescriptor* descriptor);

// Requires:
// descriptor != NULL
//
// Returns:
// Java package name.
-std::string FileJavaPackage(const FileDescriptor* descriptor,
+PROTOC_EXPORT std::string FileJavaPackage(const FileDescriptor* descriptor,
Options options = {});

// Requires:
// descriptor != NULL
// Returns:
// Capitalized camel case field name.
-std::string CapitalizedFieldName(const FieldDescriptor* field);
+PROTOC_EXPORT std::string CapitalizedFieldName(const FieldDescriptor* field);

// Requires:
// descriptor != NULL
// Returns:
// Capitalized camel case oneof name.
-std::string CapitalizedOneofName(const OneofDescriptor* oneof);
+PROTOC_EXPORT std::string CapitalizedOneofName(const OneofDescriptor* oneof);

// Returns:
// Converts a name to camel-case. If cap_first_letter is true, capitalize the
// first letter.
-std::string UnderscoresToCamelCase(absl::string_view input,
+PROTOC_EXPORT std::string UnderscoresToCamelCase(absl::string_view input,
bool cap_next_letter);
// Requires:
// field != NULL
// Returns:
// Converts the field's name to camel-case, e.g. "foo_bar_baz" becomes
// "fooBarBaz" or "FooBarBaz", respectively.
-std::string UnderscoresToCamelCase(const FieldDescriptor* field);
+PROTOC_EXPORT std::string UnderscoresToCamelCase(const FieldDescriptor* field);

// Requires:
// method != NULL
// Returns:
// Similar, but for method names. (Typically, this merely has the effect
// of lower-casing the first letter of the name.)
-std::string UnderscoresToCamelCase(const MethodDescriptor* method);
+PROTOC_EXPORT std::string UnderscoresToCamelCase(const MethodDescriptor* method);

// Requires:
// field != NULL
// Returns:
// Same as UnderscoresToCamelCase, but checks for reserved keywords
-std::string UnderscoresToCamelCaseCheckReserved(const FieldDescriptor* field);
+PROTOC_EXPORT std::string UnderscoresToCamelCaseCheckReserved(const FieldDescriptor* field);


} // namespace java
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
From 1fa22abd2038cd9d40648f5fe9faca8490b6e045 Mon Sep 17 00:00:00 2001
From 20407e25e5187a88ba2ea579d725ac357b1b6907 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Wed, 9 Aug 2023 14:06:35 +1100
Subject: [PATCH 4/5] do not install vendored gmock
Subject: [PATCH 5/6] 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 5d89a5f5f..b516cbab2 100644
index 65765ca..442df60 100644
--- a/cmake/install.cmake
+++ b/cmake/install.cmake
@@ -138,10 +138,3 @@ if(protobuf_INSTALL_EXAMPLES)
@@ -162,10 +162,3 @@ if(protobuf_INSTALL_EXAMPLES)
DESTINATION "${CMAKE_INSTALL_EXAMPLEDIR}"
COMPONENT protobuf-examples)
endif()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
From a43d86c561c6094f02d5e3b5a1b8d14539cd32fa Mon Sep 17 00:00:00 2001
From 44d5fabfe3bf688df482653bacc7e0b03e93a797 Mon Sep 17 00:00:00 2001
From: "H. Vetinari" <[email protected]>
Date: Tue, 20 Feb 2024 22:21:55 +1100
Subject: [PATCH 5/5] disable MapImplTest.RandomOrdering due to flakiness
Subject: [PATCH 6/6] disable MapImplTest.RandomOrdering due to flakiness

see https://google.github.io/googletest/advanced.html#temporarily-disabling-tests
---
src/google/protobuf/map_test.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/google/protobuf/map_test.inc b/src/google/protobuf/map_test.inc
index cbd0f4461..2a58cc92a 100644
index fe66d9c..3bb8df7 100644
--- a/src/google/protobuf/map_test.inc
+++ b/src/google/protobuf/map_test.inc
@@ -1349,7 +1349,7 @@ bool MapOrderingIsRandom(int a, int b) {
Expand Down

0 comments on commit 046608c

Please sign in to comment.