From a03284c7229a503a72ee9759cfcc21f6721330a7 Mon Sep 17 00:00:00 2001 From: Cheney Wang <38240633+Cheney-W@users.noreply.github.com> Date: Tue, 28 May 2024 05:33:42 +0800 Subject: [PATCH] [brpc] update to 1.9.0 (#38918) Fixes https://github.com/microsoft/vcpkg/issues/38799 Update `brpc` to the latest version 1.9.0. No feature needs to be tested. Remove unnecessary patch file. - [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [x] SHA512s are updated for each updated download. - [ ] ~The "supports" clause reflects platforms that may be fixed by this new version.~ - [ ] ~Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file.~ - [x] Any patches that are no longer applied are deleted from the port's directory. - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file. --- ports/brpc/fix-boost-ptr.patch | 14 ----- ports/brpc/fix-build.patch | 93 +++++++++++++++++++--------------- ports/brpc/fix-glog.patch | 49 ++++++++++-------- ports/brpc/portfile.cmake | 7 ++- ports/brpc/vcpkg.json | 5 +- versions/b-/brpc.json | 5 ++ versions/baseline.json | 4 +- 7 files changed, 91 insertions(+), 86 deletions(-) delete mode 100644 ports/brpc/fix-boost-ptr.patch diff --git a/ports/brpc/fix-boost-ptr.patch b/ports/brpc/fix-boost-ptr.patch deleted file mode 100644 index bd468ee8a0..0000000000 --- a/ports/brpc/fix-boost-ptr.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/src/brpc/policy/thrift_protocol.cpp b/src/brpc/policy/thrift_protocol.cpp -index 9871c01..269cfe1 100644 ---- a/src/brpc/policy/thrift_protocol.cpp -+++ b/src/brpc/policy/thrift_protocol.cpp -@@ -45,8 +45,7 @@ - #if defined(_THRIFT_STDCXX_H_) - # define THRIFT_STDCXX apache::thrift::stdcxx - #else -- # define THRIFT_STDCXX boost -- # include -+ # define THRIFT_STDCXX std - #endif - #endif - diff --git a/ports/brpc/fix-build.patch b/ports/brpc/fix-build.patch index 89376a4d98..fa57f6e14e 100644 --- a/ports/brpc/fix-build.patch +++ b/ports/brpc/fix-build.patch @@ -1,18 +1,18 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index f364cd13..f4add26d 100644 +index b14fe17..ecce87c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -66,7 +66,8 @@ endif() +@@ -68,7 +68,8 @@ endif() if(WITH_THRIFT) set(THRIFT_CPP_FLAG "-DENABLE_THRIFT_FRAMED_PROTOCOL") -- set(THRIFT_LIB "thrift") +- find_library(THRIFT_LIB NAMES thrift) + find_package(Thrift CONFIG REQUIRED) + set(THRIFT_LIB "thrift::thrift") - endif() - - set(WITH_RDMA_VAL "0") -@@ -150,11 +151,15 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if (NOT THRIFT_LIB) + message(FATAL_ERROR "Fail to find Thrift") + endif() +@@ -153,7 +154,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() endif() @@ -20,6 +20,12 @@ index f364cd13..f4add26d 100644 +find_package(protobuf CONFIG REQUIRED) +get_target_property(PROTOBUF_INCLUDE_DIR protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES) +set(PROTOBUF_LIBRARIES protobuf::libprotobuf) + if(Protobuf_VERSION GREATER 4.21) + # required by absl + set(CMAKE_CXX_STANDARD 17) +@@ -199,9 +202,11 @@ else() + use_cxx11() + endif() find_package(Threads REQUIRED) +find_package(ZLIB REQUIRED) @@ -30,7 +36,7 @@ index f364cd13..f4add26d 100644 if ((NOT LEVELDB_INCLUDE_PATH) OR (NOT LEVELDB_LIB)) message(FATAL_ERROR "Fail to find leveldb") endif() -@@ -169,8 +174,9 @@ if(WITH_SNAPPY) +@@ -216,8 +221,9 @@ if(WITH_SNAPPY) endif() if(WITH_GLOG) @@ -42,7 +48,7 @@ index f364cd13..f4add26d 100644 if((NOT GLOG_INCLUDE_PATH) OR (NOT GLOG_LIB)) message(FATAL_ERROR "Fail to find glog") endif() -@@ -197,7 +203,7 @@ if(WITH_RDMA) +@@ -244,7 +250,7 @@ if(WITH_RDMA) endif() endif() @@ -51,32 +57,29 @@ index f364cd13..f4add26d 100644 if(NOT PROTOC_LIB) message(FATAL_ERROR "Fail to find protoc lib") endif() -@@ -208,7 +214,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") +@@ -259,7 +265,7 @@ else() ) + endif() + +- find_package(OpenSSL) ++ find_package(OpenSSL REQUIRED) + include_directories(${OPENSSL_INCLUDE_DIR}) endif() --find_package(OpenSSL) -+find_package(OpenSSL REQUIRED) - - include_directories( - ${GFLAGS_INCLUDE_PATH} -@@ -223,11 +229,11 @@ set(DYNAMIC_LIB +@@ -275,9 +281,10 @@ set(DYNAMIC_LIB ${LEVELDB_LIB} ${PROTOC_LIB} ${CMAKE_THREAD_LIBS_INIT} -- ${THRIFT_LIB} -- ${THRIFTNB_LIB} - ${OPENSSL_CRYPTO_LIBRARY} + ${OPENSSL_SSL_LIBRARY} -+ ${THRIFT_LIB} + ${THRIFT_LIB} dl - z) + ZLIB::ZLIB) - if(WITH_MESALINK) - list(APPEND DYNAMIC_LIB ${MESALINK_LIB}) + if(WITH_BORINGSSL) + list(APPEND DYNAMIC_LIB ${BORINGSSL_SSL_LIBRARY}) diff --git a/cmake/FindGFLAGS.cmake b/cmake/FindGFLAGS.cmake -index dfad5fd8..8423d55a 100644 +index dfad5fd..8423d55 100644 --- a/cmake/FindGFLAGS.cmake +++ b/cmake/FindGFLAGS.cmake @@ -24,7 +24,9 @@ if (GFLAGS_STATIC) @@ -91,10 +94,10 @@ index dfad5fd8..8423d55a 100644 set(GFLAGS_FOUND TRUE) endif(GFLAGS_INCLUDE_PATH AND GFLAGS_LIBRARY) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index fbcc7cc5..868270ea 100644 +index 1b4b233..8e836a4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -31,16 +31,24 @@ add_dependencies(SOURCES_LIB PROTO_LIB) +@@ -31,6 +31,7 @@ add_dependencies(SOURCES_LIB PROTO_LIB) set_property(TARGET ${SOURCES_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1) set_property(TARGET ${BUTIL_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1) @@ -102,26 +105,29 @@ index fbcc7cc5..868270ea 100644 add_library(brpc-static STATIC $ $ $) +@@ -60,12 +61,19 @@ endfunction() --if(BRPC_WITH_THRIFT) -- target_link_libraries(brpc-static thrift) -+if(WITH_THRIFT) -+ target_link_libraries(brpc-static ${THRIFT_LIB}) + + if(WITH_THRIFT) +- target_link_libraries(brpc-static ${THRIFT_LIB}) +- check_thrift_version(brpc-static) ++ target_link_libraries(brpc-static PUBLIC ${THRIFT_LIB}) endif() +target_link_libraries(brpc-static PUBLIC ${DYNAMIC_LIB}) +if(BRPC_WITH_GLOG) -+ target_link_libraries(brpc-static ${GLOG_LIB}) ++ target_link_libraries(brpc-static PUBLIC ${GLOG_LIB}) +endif() +target_include_directories(brpc-static PUBLIC $) ++ SET_TARGET_PROPERTIES(brpc-static PROPERTIES OUTPUT_NAME brpc CLEAN_DIRECT_OUTPUT 1) - +endif() + +if(0) # for protoc-gen-mcpack set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/output/bin) -@@ -49,35 +57,63 @@ set(protoc_gen_mcpack_SOURCES +@@ -74,36 +82,64 @@ set(protoc_gen_mcpack_SOURCES ) add_executable(protoc-gen-mcpack ${protoc_gen_mcpack_SOURCES}) @@ -131,23 +137,26 @@ index fbcc7cc5..868270ea 100644 add_library(brpc-shared SHARED $ $ $) - target_link_libraries(brpc-shared ${DYNAMIC_LIB}) +- target_link_libraries(brpc-shared ${DYNAMIC_LIB}) ++ target_link_libraries(brpc-shared PUBLIC ${DYNAMIC_LIB}) + target_include_directories(brpc-shared PUBLIC $) - if(BRPC_WITH_GLOG) - target_link_libraries(brpc-shared ${GLOG_LIB}) + if(WITH_GLOG) +- target_link_libraries(brpc-shared ${GLOG_LIB}) ++ target_link_libraries(brpc-shared PUBLIC ${GLOG_LIB}) endif() -- if(BRPC_WITH_THRIFT) -- target_link_libraries(brpc-shared thrift) -+ if(WITH_THRIFT) -+ target_link_libraries(brpc-shared ${THRIFT_LIB}) + if(WITH_THRIFT) +- target_link_libraries(brpc-shared ${THRIFT_LIB}) +- check_thrift_version(brpc-shared) ++ target_link_libraries(brpc-shared PUBLIC ${THRIFT_LIB}) endif() SET_TARGET_PROPERTIES(brpc-shared PROPERTIES OUTPUT_NAME brpc CLEAN_DIRECT_OUTPUT 1) - ++ + if(0) target_link_libraries(protoc-gen-mcpack brpc-shared ${DYNAMIC_LIB} pthread) -- -- install(TARGETS brpc-shared + endif() + +- install(TARGETS brpc-shared + install(TARGETS brpc-shared EXPORT unofficial-brpcTargets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} @@ -160,7 +169,7 @@ index fbcc7cc5..868270ea 100644 +endif() - +- -install(TARGETS brpc-static +if(NOT BUILD_SHARED_LIBS) +install(TARGETS brpc-static EXPORT unofficial-brpcTargets diff --git a/ports/brpc/fix-glog.patch b/ports/brpc/fix-glog.patch index 04800e98c0..d4e4c656c6 100644 --- a/ports/brpc/fix-glog.patch +++ b/ports/brpc/fix-glog.patch @@ -1,12 +1,11 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index f4add26d..b87e8455 100644 +index ecce87c..3d938d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -80,9 +80,10 @@ include(GNUInstallDirs) - configure_file(${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_SOURCE_DIR}/src/butil/config.h @ONLY) +@@ -86,8 +86,10 @@ configure_file(${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_SOURCE_DIR}/src/butil set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) -- + -find_package(GFLAGS REQUIRED) - +set(GFLAGS_USE_TARGET_NAMESPACE ON) @@ -16,7 +15,7 @@ index f4add26d..b87e8455 100644 execute_process( COMMAND bash -c "grep \"namespace [_A-Za-z0-9]\\+ {\" ${GFLAGS_INCLUDE_PATH}/gflags/gflags_declare.h | head -1 | awk '{print $2}' | tr -d '\n'" OUTPUT_VARIABLE GFLAGS_NS -@@ -93,6 +94,8 @@ if(${GFLAGS_NS} STREQUAL "GFLAGS_NAMESPACE") +@@ -98,6 +100,8 @@ if(${GFLAGS_NS} STREQUAL "GFLAGS_NAMESPACE") OUTPUT_VARIABLE GFLAGS_NS ) endif() @@ -25,7 +24,7 @@ index f4add26d..b87e8455 100644 include_directories( ${PROJECT_SOURCE_DIR}/src -@@ -122,21 +125,21 @@ set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} ${DEBUG_SYMBOL} ${THRIFT_CPP_FLAG}") +@@ -127,19 +131,19 @@ set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} ${DEBUG_SYMBOL} ${THRIFT_CPP_FLAG}") set(CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer") set(CMAKE_C_FLAGS "${CMAKE_CPP_FLAGS} -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-unused-parameter -fno-omit-frame-pointer") @@ -48,43 +47,51 @@ index f4add26d..b87e8455 100644 -endmacro(use_cxx11) +endmacro(use_cxx14) --use_cxx11() -+use_cxx14() - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") #required by butil/crc32.cc to boost performance for 10x +@@ -199,7 +203,7 @@ if(Protobuf_VERSION GREATER 4.21) + absl::variant + ) + else() +- use_cxx11() ++ use_cxx14() + endif() + find_package(Threads REQUIRED) + find_package(ZLIB REQUIRED) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 868270ea..a70ad23f 100644 +index 8e836a4..c1b1f36 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -31,6 +31,10 @@ add_dependencies(SOURCES_LIB PROTO_LIB) +@@ -30,6 +30,10 @@ add_dependencies(SOURCES_LIB PROTO_LIB) + # shared library needs POSITION_INDEPENDENT_CODE set_property(TARGET ${SOURCES_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1) set_property(TARGET ${BUTIL_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1) - +if(BRPC_WITH_GLOG) + target_link_libraries(BUTIL_LIB PUBLIC ${GLOG_LIB}) + target_link_libraries(SOURCES_LIB PUBLIC ${GLOG_LIB}) +endif() + if(NOT BUILD_SHARED_LIBS) add_library(brpc-static STATIC $ - $ -@@ -41,9 +45,6 @@ if(WITH_THRIFT) +@@ -65,9 +69,7 @@ if(WITH_THRIFT) endif() target_link_libraries(brpc-static PUBLIC ${DYNAMIC_LIB}) -if(BRPC_WITH_GLOG) -- target_link_libraries(brpc-static ${GLOG_LIB}) +- target_link_libraries(brpc-static PUBLIC ${GLOG_LIB}) -endif() ++ target_include_directories(brpc-static PUBLIC $) - SET_TARGET_PROPERTIES(brpc-static PROPERTIES OUTPUT_NAME brpc CLEAN_DIRECT_OUTPUT 1) -@@ -65,9 +66,6 @@ if(BUILD_SHARED_LIBS) + SET_TARGET_PROPERTIES(brpc-static PROPERTIES OUTPUT_NAME brpc CLEAN_DIRECT_OUTPUT 1) +@@ -90,9 +92,7 @@ if(BUILD_SHARED_LIBS) $) - target_link_libraries(brpc-shared ${DYNAMIC_LIB}) + target_link_libraries(brpc-shared PUBLIC ${DYNAMIC_LIB}) target_include_directories(brpc-shared PUBLIC $) -- if(BRPC_WITH_GLOG) -- target_link_libraries(brpc-shared ${GLOG_LIB}) +- if(WITH_GLOG) +- target_link_libraries(brpc-shared PUBLIC ${GLOG_LIB}) - endif() ++ if(WITH_THRIFT) - target_link_libraries(brpc-shared ${THRIFT_LIB}) + target_link_libraries(brpc-shared PUBLIC ${THRIFT_LIB}) endif() diff --git a/ports/brpc/portfile.cmake b/ports/brpc/portfile.cmake index 704c4b95e2..83cafa4fe4 100644 --- a/ports/brpc/portfile.cmake +++ b/ports/brpc/portfile.cmake @@ -1,12 +1,11 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO apache/incubator-brpc + REPO apache/brpc REF "${VERSION}" - SHA512 da0004b7b50cc48da018627c9361ae62b006bb7cd2af53a5cfa1601aab7ad31174d37778a42809bdf2e0f2021a860dcbb02e2c3c938eae6c02808267c3b85025 + SHA512 a908c3cf63224d6fb98f1855aca75c3adf528c40da5180c6e298cc52ee9ccbef08809a81078333bdd6ac1a4af54448edac8dd4e0333e72e9dec2790454355e7a HEAD_REF master PATCHES fix-build.patch - fix-boost-ptr.patch fix-glog.patch ) @@ -28,6 +27,6 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/butil/third_party/superfast vcpkg_copy_pdbs() -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") vcpkg_fixup_pkgconfig() diff --git a/ports/brpc/vcpkg.json b/ports/brpc/vcpkg.json index 20a60977f2..fb5da5be92 100644 --- a/ports/brpc/vcpkg.json +++ b/ports/brpc/vcpkg.json @@ -1,9 +1,8 @@ { "name": "brpc", - "version": "1.6.1", - "port-version": 3, + "version": "1.9.0", "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", + "homepage": "https://github.com/apache/brpc", "license": "Apache-2.0", "supports": "!windows & !(arm & android)", "dependencies": [ diff --git a/versions/b-/brpc.json b/versions/b-/brpc.json index bac2351560..b73ff58972 100644 --- a/versions/b-/brpc.json +++ b/versions/b-/brpc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5c492561a044534b4177cf14d9296c8a68431755", + "version": "1.9.0", + "port-version": 0 + }, { "git-tree": "4aa97cf4dfb7c0ff2537a3b0e324daa97940d2c5", "version": "1.6.1", diff --git a/versions/baseline.json b/versions/baseline.json index bbe78b18ba..34b09e62f8 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1369,8 +1369,8 @@ "port-version": 1 }, "brpc": { - "baseline": "1.6.1", - "port-version": 3 + "baseline": "1.9.0", + "port-version": 0 }, "brunocodutra-metal": { "baseline": "2.1.4",