Bug #118161 Having Homebrew-installed googletest breaks build

Submitted: 12 May 2025 6:57 Modified: 27 Oct 2025 6:49
Reporter: Laurynas Biveinis (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.43 OS:MacOS (15.4.1)
Assigned to: CPU Architecture:ARM

[12 May 2025 6:57] Laurynas Biveinis
Description:
$ brew install googletest
... success ...
$ cmake .. -DCMAKE_BUILD_TYPE=Debug -DWITH_DEBUG=ON -DMYSQL_MAINTAINER_MODE=ON -DWITH_SYSTEM_LIBS=ON -DWITH_NDBCLUSTER_STORAGE_ENGINE=OFF -DDOWNLOAD_BOOST=ON -DWITH_BOOST=path -DCMAKE_CXX_FLAGS=-g -DCMAKE_CXX_FLAGS_DEBUG=-g -DCMAKE_CXX_FLAGS_RELEASE=-g -O2 -DNDEBUG -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm@14/bin/clang -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm@14/bin/clang++ -DCMAKE_AR=/opt/homebrew/opt/llvm@14/bin/llvm-ar
...
build results in
AILED: CMakeFiles/gmock.dir/extra/googletest/googletest-1.14.0/googlemock/src/gmock-all.cc.o
/opt/homebrew/opt/llvm@14/bin/clang++ -DBOOST_NO_CXX98_FUNCTION_BASE -DHAVE_TLSv13 -DLZ4_DISABLE_DEPRECATE_WARNINGS -D_USE_MATH_DEFINES -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/laurynas/vilniusdb/mysql-8.0.42/_build-llvm-14-debug -I/Users/laurynas/vilniusdb/mysql-8.0.42/_build-llvm-14-debug/include -I/Users/laurynas/vilniusdb/mysql-8.0.42 -I/Users/laurynas/vilniusdb/mysql-8.0.42/include -isystem /Users/laurynas/vilniusdb/mysql-8.0.42/extra/rapidjson/include -isystem /opt/homebrew/opt/openssl@1.1/include -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/editline -isystem /opt/homebrew/include -isystem /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googlemock -isystem /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googlemock/include -isystem /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest -isystem /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest/include -std=c++17 -fno-omit-frame-pointer -ftls-model=initial-exec -g -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Woverloaded-virtual -Wcast-qual -Wno-null-conversion -Wno-unused-private-field -Wconditional-uninitialized -Wdeprecated -Wno-deprecated-declarations -Wno-shorten-64-to-32 -Wextra-semi -Wheader-hygiene -Wnon-virtual-dtor -Wundefined-reinterpret-cast -Wrange-loop-analysis -Winconsistent-missing-destructor-override -Winconsistent-missing-override -Wshadow-field -Werror -DSAFE_MUTEX -DENABLED_DEBUG_SYNC -g -arch arm64 -fPIC -fcolor-diagnostics -MD -MT CMakeFiles/gmock.dir/extra/googletest/googletest-1.14.0/googlemock/src/gmock-all.cc.o -MF CMakeFiles/gmock.dir/extra/googletest/googletest-1.14.0/googlemock/src/gmock-all.cc.o.d  --language=c++  -o CMakeFiles/gmock.dir/extra/googletest/googletest-1.14.0/googlemock/src/gmock-all.cc.o -c /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googlemock/src/gmock-all.cc
In file included from /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googlemock/src/gmock-all.cc:43:
/Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googlemock/src/gmock-internal-utils.cc:214:46: error: no template named 'IndexSequence'; did you mean 'std::index_sequence'?
constexpr std::array<char, 256> UnBase64Impl(IndexSequence<I...>,
                                             ^
/opt/homebrew/opt/llvm@14/bin/../include/c++/v1/__utility/integer_sequence.h:37:5: note: 'std::index_sequence' declared here
    using index_sequence = integer_sequence<size_t, _Ip...>;
    ^
In file included from /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googlemock/src/gmock-all.cc:43:
/Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googlemock/src/gmock-internal-utils.cc:221:23: error: use of undeclared identifier 'MakeIndexSequence'
  return UnBase64Impl(MakeIndexSequence<256>{}, base64);
                      ^
/Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googlemock/src/gmock-internal-utils.cc:220:33: error: no return statement in constexpr function
constexpr std::array<char, 256> UnBase64(const char* const base64) {
                                ^
3 errors generated.
[1765/3836] Building CXX object CMakeFiles/gtest.dir/extra/googletest/googletest-1.14.0/googletest/src/gtest-all.cc.o
FAILED: CMakeFiles/gtest.dir/extra/googletest/googletest-1.14.0/googletest/src/gtest-all.cc.o
/opt/homebrew/opt/llvm@14/bin/clang++ -DBOOST_NO_CXX98_FUNCTION_BASE -DHAVE_TLSv13 -DLZ4_DISABLE_DEPRECATE_WARNINGS -D_USE_MATH_DEFINES -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/Users/laurynas/vilniusdb/mysql-8.0.42/_build-llvm-14-debug -I/Users/laurynas/vilniusdb/mysql-8.0.42/_build-llvm-14-debug/include -I/Users/laurynas/vilniusdb/mysql-8.0.42 -I/Users/laurynas/vilniusdb/mysql-8.0.42/include -isystem /Users/laurynas/vilniusdb/mysql-8.0.42/extra/rapidjson/include -isystem /opt/homebrew/opt/openssl@1.1/include -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/editline -isystem /opt/homebrew/include -isystem /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googlemock -isystem /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googlemock/include -isystem /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest -isystem /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest/include -std=c++17 -fno-omit-frame-pointer -ftls-model=initial-exec -g -Wall -Wextra -Wformat-security -Wvla -Wundef -Wmissing-format-attribute -Woverloaded-virtual -Wcast-qual -Wno-null-conversion -Wno-unused-private-field -Wconditional-uninitialized -Wdeprecated -Wno-deprecated-declarations -Wno-shorten-64-to-32 -Wextra-semi -Wheader-hygiene -Wnon-virtual-dtor -Wundefined-reinterpret-cast -Wrange-loop-analysis -Winconsistent-missing-destructor-override -Winconsistent-missing-override -Wshadow-field -Werror -DSAFE_MUTEX -DENABLED_DEBUG_SYNC -g -arch arm64 -fPIC -fcolor-diagnostics -MD -MT CMakeFiles/gtest.dir/extra/googletest/googletest-1.14.0/googletest/src/gtest-all.cc.o -MF CMakeFiles/gtest.dir/extra/googletest/googletest-1.14.0/googletest/src/gtest-all.cc.o.d  --language=c++  -o CMakeFiles/gtest.dir/extra/googletest/googletest-1.14.0/googletest/src/gtest-all.cc.o -c /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest/src/gtest-all.cc
In file included from /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest/src/gtest-all.cc:49:
/Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest/src/gtest.cc:2720:11: error: out-of-line definition of 'TestInfo' does not match any declaration in 'testing::TestInfo'
TestInfo::TestInfo(const std::string& a_test_suite_name,
          ^~~~~~~~
/opt/homebrew/include/gtest/gtest.h:618:12: note: type of 1st parameter of member declaration does not match definition ('std::string' (aka 'basic_string<char, char_traits<char>, allocator<char>>') vs 'const std::string &' (aka 'const basic_string<char, char_traits<char>, allocator<char>> &'))
  TestInfo(std::string test_suite_name, std::string name,
           ^
In file included from /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest/src/gtest-all.cc:49:
/Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest/src/gtest.cc:2769:11: error: calling a private constructor of class 'testing::TestInfo'
      new TestInfo(test_suite_name, name, type_param, value_param,
          ^
/opt/homebrew/include/gtest/gtest.h:618:3: note: declared private here
  TestInfo(std::string test_suite_name, std::string name,
  ^
In file included from /Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest/src/gtest-all.cc:49:
/Users/laurynas/vilniusdb/mysql-8.0.42/extra/googletest/googletest-1.14.0/googletest/src/gtest.cc:2929:12: error: out-of-line definition of 'TestSuite' does not match any declaration in 'testing::TestSuite'
TestSuite::TestSuite(const char* a_name, const char* a_type_param,
           ^~~~~~~~~

brew unlink googletest is a workaround.

How to repeat:
See above.

Suggested fix:
Ensure bundled and system google test instances are properly separated
[12 May 2025 8:44] MySQL Verification Team
Hello Laurynas,

Thank you for the report and feedback.

regards,
Umesh
[27 Oct 2025 6:49] Laurynas Biveinis
Does not reproduce with 8.0.44, leaving it for you to close in case you want to update the release notes.

(reproduces with 8.0.43)

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.041 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.