[brpc] Fix build failed when protobuf update to 3.19.3 (#22685)

* [brpc] Fix build failed when protobuf update to 3.19.3

* update version

* Add license

* update version

* Add support in vcpkg.json

* update version

* update version

* update patch

* remove patch

* update patch name

* update version

Co-authored-by: Lily Wang <v-lilywang@microsoft.com>
This commit is contained in:
LilyWangLL 2022-01-28 01:09:26 +08:00 committed by GitHub
parent 0921a9a278
commit 07e508359c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 24 deletions

View File

@ -1,13 +0,0 @@
diff --git a/src/brpc/protocol.cpp b/src/brpc/protocol.cpp
index 11297ea..c998edb 100644
--- a/src/brpc/protocol.cpp
+++ b/src/brpc/protocol.cpp
@@ -203,7 +203,7 @@ BUTIL_FORCE_INLINE bool ParsePbFromZeroCopyStreamInlined(
// According to source code of pb, SetTotalBytesLimit is not a simple set,
// avoid calling the function when the limit is definitely unreached.
if (PB_TOTAL_BYETS_LIMITS < FLAGS_max_body_size) {
- decoder.SetTotalBytesLimit(INT_MAX, -1);
+ decoder.SetTotalBytesLimit(INT_MAX);
}
return msg->ParseFromCodedStream(&decoder) && decoder.ConsumedEntireMessage();
}

View File

@ -1,3 +1,9 @@
vcpkg_download_distfile(patch1679
URLS "https://patch-diff.githubusercontent.com/raw/apache/incubator-brpc/pull/1679.diff"
FILENAME "apache-incubator-brpc-1679.diff"
SHA512 4b1e5717b44aa6a741ddd49b1408e3e556f6d845d5e8a5cfccf2f2d7ebe39aed19c3dad703db7a9ebd0446ac1f225e7dbdd2ff1f23f34fd60c3ef59aaa07b789
)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO apache/incubator-brpc
@ -7,26 +13,25 @@ vcpkg_from_github(
PATCHES
fix_boost_ptr.patch
fix_thrift.patch
fix-protobuf-deprecated.patch
${patch1679}
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DWITH_THRIFT=ON
-DWITH_MESALINK=OFF
-DWITH_GLOG=ON
)
vcpkg_install_cmake()
vcpkg_cmake_install()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/butil/third_party/superfasthash")
vcpkg_copy_pdbs()
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_fixup_pkgconfig()

View File

@ -1,9 +1,10 @@
{
"name": "brpc",
"version-string": "0.9.7",
"port-version": 4,
"port-version": 5,
"description": "Industrial-grade RPC framework used throughout Baidu, with 1,000,000+ instances and thousands kinds of services, called \"baidu-rpc\" inside Baidu.",
"homepage": "https://github.com/apache/incubator-brpc",
"license": "Apache-2.0",
"supports": "!windows",
"dependencies": [
"gflags",
@ -16,6 +17,10 @@
"zlib"
]
},
"thrift"
"thrift",
{
"name": "vcpkg-cmake",
"host": true
}
]
}

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "eb37098c32016db48b15a29bd31b08087c7b5d0e",
"version-string": "0.9.7",
"port-version": 5
},
{
"git-tree": "7c6f7c8a882730bd20874fb5832081105a169c7a",
"version-string": "0.9.7",

View File

@ -1146,7 +1146,7 @@
},
"brpc": {
"baseline": "0.9.7",
"port-version": 4
"port-version": 5
},
"brunocodutra-metal": {
"baseline": "2.1.3",