Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade bundled Google Test version #1726

Closed
antonsviridenko opened this issue Dec 30, 2021 · 3 comments · Fixed by #1885
Closed

Upgrade bundled Google Test version #1726

antonsviridenko opened this issue Dec 30, 2021 · 3 comments · Fixed by #1885
Assignees

Comments

@antonsviridenko
Copy link
Contributor

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
google/googletest#3219

Steps to Reproduce

  1. Configure build with options -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=Debug -DDOWNLOAD_GTEST=On
  2. Use GCC 11 to build
gcc --version
gcc (Gentoo 11.2.0 p1) 11.2.0
  1. try to build
@antonsviridenko
Copy link
Contributor Author

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?

@ronaldtse
Copy link
Contributor

I'm fine with using GoogleTest as head. I have reservations with always deploying code at head, because deployment is not an atomic task.

@ni4
Copy link
Contributor

ni4 commented Jul 30, 2022

@antonsviridenko I'm fine with proposed changes, let's switch to HEAD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants