rnp
rnp copied to clipboard
Upgrade bundled Google Test version
Description
Google Test version downloaded by rnp build scripts fails to build with GCC 11
[ 11%] Building CXX object src/lib/CMakeFiles/librnp-obj.dir/__/librepgp/stream-write.cpp.o
In file included from /home/odsk/Ribose/rnp/build/_deps/googletest-src/googletest/src/gtest-all.cc:42:
/home/odsk/Ribose/rnp/build/_deps/googletest-src/googletest/src/gtest-death-test.cc: In function ‘bool testing::internal::StackGrowsDown()’:
/home/odsk/Ribose/rnp/build/_deps/googletest-src/googletest/src/gtest-death-test.cc:1301:24: error: ‘dummy’ may be used uninitialized [-Werror=maybe-uninitialized]
1301 | StackLowerThanAddress(&dummy, &result);
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
/home/odsk/Ribose/rnp/build/_deps/googletest-src/googletest/src/gtest-death-test.cc:1290:13: note: by argument 1 of type ‘const void*’ to ‘void testing::internal::StackLowerThanAddress(const void*, bool*)’ declared here
1290 | static void StackLowerThanAddress(const void* ptr, bool* result) {
| ^~~~~~~~~~~~~~~~~~~~~
/home/odsk/Ribose/rnp/build/_deps/googletest-src/googletest/src/gtest-death-test.cc:1299:7: note: ‘dummy’ declared here
1299 | int dummy;
| ^~~~~
This is a known bug, already fixed in upstream https://github.com/google/googletest/issues/3219
Steps to Reproduce
- Configure build with options
-DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=Debug -DDOWNLOAD_GTEST=On
- Use GCC 11 to build
gcc --version
gcc (Gentoo 11.2.0 p1) 11.2.0
- try to build
Changing GIT TAG
to main
in https://github.com/rnpgp/rnp/blob/master/src/tests/CMakeLists.txt#L54 fixes this issue for me.
Google recommends to use latest commit from the repo
GoogleTest now follows the Abseil Live at Head philosophy. We recommend updating to the latest commit in the main branch as often as possible.
@ni4 what do you think?
I'm fine with using GoogleTest as head. I have reservations with always deploying code at head, because deployment is not an atomic task.
@antonsviridenko I'm fine with proposed changes, let's switch to HEAD.