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

The 20211102.0 version uses unpublished GTEST_FLAG_GET macro from googletest #1063

Closed
PawelWMS opened this issue Nov 16, 2021 · 3 comments
Closed
Labels

Comments

@PawelWMS
Copy link

Describe the bug

In the 20211102.0 version of abseil-cpp some of the test code started using the GTEST_FLAG_GET macro. This causes the following build failures when attempting a CMake build with a pre-installed, latest released version (1.11.0) of googletest:

[ 47%] Built target absl_cord_internal_test"
absl/strings/cord_ring_test.cc: In function 'absl::lts_20211102::{anonymous}::Composition absl::lts_20211102::{anonymous}::RandomComposition()':"
absl/strings/cord_ring_test.cc:278:35: error: 'random_seed' was not declared in this scope; did you mean 'random_r'?"
  278 |   RandomEngine rng(GTEST_FLAG_GET(random_seed));"
      |                                   ^~~~~~~~~~~"
      |                                   random_r"
absl/strings/cord_ring_test.cc:278:20: error: 'GTEST_FLAG_GET' was not declared in this scope; did you mean 'GTEST_FLAG'?"
  278 |   RandomEngine rng(GTEST_FLAG_GET(random_seed));"
      |                    ^~~~~~~~~~~~~~"
      |                    GTEST_FLAG"

After taking a look at the GoogleTest GitHub repository it seems, that the changes introducing this macro are only present in the main branch but haven't been packed into an official release, yet.

Steps to reproduce the bug

  1. Install the 1.11.0 version of GoogleTest.
  2. Configure the abseil-cpp build with CMake (version >= 3.20.0) and the -DABSL_FIND_GOOGLETEST=ON -DABSL_USE_EXTERNAL_GOOGLETEST=ON -DBUILD_TESTING=ON options.
  3. Build with make.

What version of Abseil are you using?

20211102.0

What operating system and version are you using

Docker container on a Ubuntu 18.04 host.

What compiler and version are you using?

gcc: 9.1.0

What build system are you using?

cmake: 3.21.4
make: 4.2.1

Additional context

None.

@PawelWMS PawelWMS added the bug label Nov 16, 2021
@PawelWMS
Copy link
Author

Now I've also noticed that this version of abseil-cpp is also relying on ::testing::Conditional, which is GTest matcher, which also didn't make it to any official release, yet. After providing a dummy macro for GTEST_FLAG_GET and removing the use of ::testing::Conditional the project built along with all tests, so I think those are the only two.

@derekmauro
Copy link
Member

The June 2022 release addresses this issue. A coordinated GoogleTest release was done to ensure compatibility, and our release documentation has been updated so ensure future releases are coordinated as well.

@WildSouthern

This comment was marked as spam.

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

No branches or pull requests

3 participants