From 45e76ce49e74d6acb17786384f4c1e08306373fa Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Mon, 20 Apr 2020 08:41:14 +0200 Subject: src/murmur/MurmurGRPCImpl.h: Use namespace grpc instead of grpc_impl It appears as if more modern versions of GRPC-c++ have moved their classes from namespace grpc to namespace grpc_impl, which is what the most recent contribution to this file was using. However in older versions of the GRPC library this namespace doesn't exist yet and thus causes compile errors. Luckily it seems however that the GRPC devs were smart about this change as they added typedefs to the grpc namespace (which still exists) that reroute to the grpc_impl namespace. Thus we can simply use the grpc namespace and in newer versions this will redirect us to the grpc_impl namespace automatically. As a reference on the GRPC side see https://github.com/grpc/grpc/commit/d684ddc7e3091b8b5205b0cadbd786bd5f37487d --- src/murmur/MurmurGRPCImpl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/murmur/MurmurGRPCImpl.h b/src/murmur/MurmurGRPCImpl.h index 6f5e3ee80..14b62c088 100644 --- a/src/murmur/MurmurGRPCImpl.h +++ b/src/murmur/MurmurGRPCImpl.h @@ -39,7 +39,7 @@ namespace MurmurRPC { } } -class MurmurRPCAuthenticator : public ::grpc_impl::AuthMetadataProcessor { +class MurmurRPCAuthenticator : public ::grpc::AuthMetadataProcessor { public: MurmurRPCAuthenticator(); grpc::Status Process(const InputMetadata&, ::grpc::AuthContext*, OutputMetadata*, OutputMetadata*); -- cgit v1.2.3 From fa8e9b2fcbba412787d87b9591367bfb630ad4c5 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Mon, 20 Apr 2020 08:51:21 +0200 Subject: src/murmur/MurmurGRPCImpl.cpp: Use QAtomicInteger::loadRelaxed() instead of QAtomicInteger::load() for Qt >= 5.14 --- src/murmur/MurmurGRPCImpl.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/murmur/MurmurGRPCImpl.cpp b/src/murmur/MurmurGRPCImpl.cpp index d54fed54b..cb275062c 100644 --- a/src/murmur/MurmurGRPCImpl.cpp +++ b/src/murmur/MurmurGRPCImpl.cpp @@ -283,7 +283,12 @@ void ToRPC(const ::Server *srv, const ::User *u, ::MurmurRPC::User *ru) { ru->set_udp_ping_msecs(su->dUDPPingAvg); ru->set_tcp_ping_msecs(su->dTCPPingAvg); +#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) + ru->set_tcp_only(su->aiUdpFlag.loadRelaxed() == 0); +#else + // Qt 5.14 introduced QAtomicInteger::loadRelaxed() which deprecates QAtomicInteger::load() ru->set_tcp_only(su->aiUdpFlag.load() == 0); +#endif ru->set_address(su->haAddress.toStdString()); } -- cgit v1.2.3 From 4ab0e03492f65ec29009250733124d4c05b62303 Mon Sep 17 00:00:00 2001 From: Robert Adam Date: Mon, 20 Apr 2020 08:56:21 +0200 Subject: CI: Include GRPC support We have had multiple cases now in which there have been some errors in changes related to GRPC that weren't detected by the CI because it excluded the GRPC code from the build process. This will bw changed now. As all other CIs have been stubborn, for now we'll only build GRPC on travis as these use a new-enough Ubuntu version to be able to build GRPC. MacOS CI I haven't got to work with the whole homebrew stuff and Windows is done in its own repo (which I won't touch either). m --- scripts/travis-ci/before_install.bash | 3 ++- scripts/travis-ci/script.bash | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/travis-ci/before_install.bash b/scripts/travis-ci/before_install.bash index 53627b8ed..7ac278c99 100755 --- a/scripts/travis-ci/before_install.bash +++ b/scripts/travis-ci/before_install.bash @@ -22,7 +22,8 @@ if [ "${TRAVIS_OS_NAME}" == "linux" ]; then libcap-dev libxi-dev \ libasound2-dev libpulse-dev \ libogg-dev libsndfile1-dev libspeechd-dev \ - libavahi-compat-libdnssd-dev libzeroc-ice-dev libg15daemon-client-dev + libavahi-compat-libdnssd-dev libzeroc-ice-dev libg15daemon-client-dev \ + libgrpc++-dev libprotoc-dev protobuf-compiler-grpc elif [ "${MUMBLE_HOST}" == "i686-w64-mingw32" ]; then sudo dpkg --add-architecture i386 sudo apt-get -qq update diff --git a/scripts/travis-ci/script.bash b/scripts/travis-ci/script.bash index a20851b1b..b92fd5cfb 100755 --- a/scripts/travis-ci/script.bash +++ b/scripts/travis-ci/script.bash @@ -17,11 +17,11 @@ if [ "${TRAVIS_OS_NAME}" == "linux" ]; then if [ "${MUMBLE_NO_PCH}" == "1" ]; then EXTRA_CONFIG="no-pch ${EXTRA_CONFIG}" fi - qmake CONFIG+="release tests g15-emulator ${EXTRA_CONFIG}" DEFINES+="MUMBLE_VERSION=${TRAVIS_COMMIT:0:7}" -recursive + qmake CONFIG+="release tests g15-emulator grpc ${EXTRA_CONFIG}" DEFINES+="MUMBLE_VERSION=${TRAVIS_COMMIT:0:7}" -recursive make -j2 make check elif [ "${MUMBLE_HOST}" == "aarch64-linux-gnu" ]; then - qmake CONFIG+="release tests warnings-as-errors ${EXTRA_CONFIG}" -recursive + qmake CONFIG+="release tests warnings-as-errors grpc ${EXTRA_CONFIG}" -recursive make -j $(nproc) elif [ "${MUMBLE_HOST}" == "i686-w64-mingw32" ]; then wget http://www.steinberg.net/sdk_downloads/asiosdk2.3.zip -P ../ -- cgit v1.2.3