* fix(grpc)

let 1.62.2 continue to build properly

* hopefully fix 1.63+
This commit is contained in:
Jacob Heider 2024-06-28 20:35:46 -04:00 committed by GitHub
parent fbd4aeded2
commit f4fdd3ee78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -16,20 +16,22 @@ provides:
- bin/grpc_cli - bin/grpc_cli
dependencies: dependencies:
abseil.io: '*' abseil.io: ^20240116
c-ares.org: '*' c-ares.org: '*'
openssl.org: ^1.1 openssl.org: ^1.1
protobuf.dev: 25.2.0 # grpc links to specific versions, so we have to pick one. protobuf.dev: 26.1.0 # grpc links to specific versions, so we have to pick one.
github.com/google/re2: '*' github.com/google/re2: '*'
zlib.net: '*' zlib.net: '*'
linux: linux:
gnu.org/gcc: '*' # libstdc++ gnu.org/gcc/libstdcxx: '*'
build: build:
dependencies: dependencies:
gnu.org/autoconf: '*' gnu.org/autoconf: '*'
gnu.org/automake: '*' gnu.org/automake: '*'
gnu.org/libtool: '*' gnu.org/libtool: '*'
darwin:
gnu.org/patch: '*'
cmake.org: ^3 cmake.org: ^3
freedesktop.org/pkg-config: ^0 freedesktop.org/pkg-config: ^0
git-scm.org: ^2 git-scm.org: ^2
@ -38,6 +40,34 @@ build:
- run: git submodule update --init --recursive - run: git submodule update --init --recursive
working-directory: ../.. working-directory: ../..
# darwin issues:
# https://github.com/grpc/grpc/issues/36654
- run: |
if test "{{hw.platform}}" = "darwin"; then
patch -i $PROP || true
fi
if: '>=1.63'
working-directory: ../..
prop: |
--- CMakeLists.txt.orig 2024-05-16 01:01:03.000000000 +0000
+++ CMakeLists.txt
@@ -3682,6 +3682,7 @@ target_include_directories(upb_json_lib
)
target_link_libraries(upb_json_lib
${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_unsecure
utf8_range_lib
upb_message_lib
)
@@ -3883,6 +3884,7 @@ target_include_directories(upb_textforma
)
target_link_libraries(upb_textformat_lib
${_gRPC_ALLTARGETS_LIBRARIES}
+ grpc++_unsecure
utf8_range_lib
upb_message_lib
)
- cmake $COMMON_ARGS $ARGS ../.. - cmake $COMMON_ARGS $ARGS ../..
- make install - make install
@ -52,7 +82,7 @@ build:
# so we need to add @loader_path to the rpath # so we need to add @loader_path to the rpath
- run: | - run: |
for f in bin/* lib/libgrpc++_test_config.dylib; do for f in bin/* lib/libgrpc++_test_config.dylib; do
if test -f $f; then if test -f $f && ! otool -l $f | grep @loader_path/../lib; then
install_name_tool -add_rpath @loader_path/../lib $f install_name_tool -add_rpath @loader_path/../lib $f
fi fi
done done
@ -72,18 +102,23 @@ build:
- -DgRPC_INSTALL=ON - -DgRPC_INSTALL=ON
- -DgRPC_ABSL_PROVIDER=package - -DgRPC_ABSL_PROVIDER=package
- -DgRPC_CARES_PROVIDER=package - -DgRPC_CARES_PROVIDER=package
- -DgRPC_PROTOBUF_PROVIDER=package
- -DgRPC_SSL_PROVIDER=package - -DgRPC_SSL_PROVIDER=package
- -DgRPC_ZLIB_PROVIDER=package - -DgRPC_ZLIB_PROVIDER=package
- -DgRPC_RE2_PROVIDER=package - -DgRPC_RE2_PROVIDER=package
CLI_ARGS: CLI_ARGS:
- -DgRPC_BUILD_TESTS=ON - -DgRPC_BUILD_TESTS=ON
# linux: darwin:
# # likely needs bumping to an unreleased abseil.io version ARGS:
# # ld.lld: error: undefined reference due to --no-allow-shlib-undefined: absl::lts_20230802::Cord::Cord<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, 0>(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>&&) - -DgRPC_PROTOBUF_PROVIDER=module
# LDFLAGS: $LDFLAGS -Wl,--allow-shlib-undefined linux:
# ARGS: CC: clang
# - -DCMAKE_EXE_LINKER_FLAGS=-Wl,-lstdc++ CXX: clang++
LD: clang
ARGS:
- -DgRPC_PROTOBUF_PROVIDER=package
CLI_ARGS:
# otherwise we get linker errors
- -DCMAKE_EXE_LINKER_FLAGS=-W,-labsl_log_internal_message
test: test:
dependencies: dependencies:
@ -98,6 +133,9 @@ test:
script: script:
- cp $FIXTURE test.cpp - cp $FIXTURE test.cpp
- PKG_CONFIG=$(pkg-config --cflags --libs libcares protobuf re2 grpc++) - PKG_CONFIG=$(pkg-config --cflags --libs libcares protobuf re2 grpc++)
- clang++ $PKG_CONFIG test.cpp -o test -lstdc++ - clang++ $PKG_CONFIG test.cpp -o test $LIBS
- ./test - ./test
- (grpc_cli ls localhost:58931 2>&1 || true) | grep -E "(failed to connect to all addresses|rpc failed)" - (grpc_cli ls localhost:58931 2>&1 || true) | grep -E "(failed to connect to all addresses|rpc failed)"
env:
linux:
LIBS: -lstdc++