indigophox opened a new issue, #39646:
URL: https://github.com/apache/arrow/issues/39646
### Describe the bug, including details regarding any error messages,
version, and platform.
C++ googletest headers don't compile properly when a system version of
googletest is present and a different version from the bundled one. This can
be bodged around by clobbering the system headers, e.g. `cp -R
_deps/googletest-src/googlemock/include /opt/homebrew/Cellar/googletest/1.14.0/`
Error behaviour looks like:
```
$ cmake --build .
[1/611] Building CXX object
_deps/googletest-build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
FAILED:
_deps/googletest-build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o
/opt/homebrew/bin/ccache
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-DARROW_EXTRA_ERROR_CONTEXT -DARROW_HAVE_NEON -DARROW_WITH_TIMING_TESTS
-DGTEST_CREATE_SHARED_LIBRARY=1 -Dgmock_EXPORTS
-I/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include
-I/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock
-isystem
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googletest/include
-isystem
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googletest
-Qunused-arguments -fcolor-diagnostics -Wno-unused-value
-Wno-ignored-attributes -g -Werror -O0 -ggdb -Wno-error -arch arm64 -isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk
-fPIC -Wall -Wshadow -Werror -Wconversion -DGTEST_HAS_PTHREAD=1 -fexceptions
-W -W
pointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch
-Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wredundant-decls
-std=c++17 -MD -MT
_deps/googletest-build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o -MF
_deps/googletest-build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o.d -o
_deps/googletest-build/googlemock/CMakeFiles/gmock.dir/src/gmock-all.cc.o -c
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/src/gmock-all.cc
In file included from
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/src/gmock-all.cc:39:
In file included from
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock.h:59:
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:342:5:
error: unknown type name 'GTEST_DISALLOW_COPY_AND_ASSIGN_'
GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer);
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:353:5:
error: unknown type name 'GTEST_DISALLOW_COPY_AND_ASSIGN_'
GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer);
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:427:3:
error: unknown type name 'GTEST_DISALLOW_COPY_AND_ASSIGN_'
GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface);
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:687:27:
error: expected parameter declarator
GTEST_COMPILE_ASSERT_(!std::is_reference<Result>::value,
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:687:27:
error: expected ')'
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:687:26:
note: to match this '('
GTEST_COMPILE_ASSERT_(!std::is_reference<Result>::value,
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:687:5:
error: a type specifier is required for all declarations
GTEST_COMPILE_ASSERT_(!std::is_reference<Result>::value,
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:694:5:
error: unknown type name 'GTEST_DISALLOW_COPY_AND_ASSIGN_'
GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:659:9:
error: use of undeclared identifier
'use_ReturnRef_instead_of_Return_to_return_a_reference'
use_ReturnRef_instead_of_Return_to_return_a_reference);
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:763:27:
error: use of undeclared identifier
'use_Return_instead_of_ReturnRef_to_return_a_value'
use_Return_instead_of_ReturnRef_to_return_a_value);
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-actions.h:806:9:
error: use of undeclared identifier
'use_Return_instead_of_ReturnRefOfCopy_to_return_a_value'
use_Return_instead_of_ReturnRefOfCopy_to_return_a_value);
^
In file included from
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/src/gmock-all.cc:39:
In file included from
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock.h:61:
In file included from
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-function-mocker.h:42:
In file included from
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-spec-builders.h:75:
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-matchers.h:316:3:
error: unknown type name 'GTEST_DISALLOW_COPY_AND_ASSIGN_'
GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener);
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-matchers.h:538:7:
error: use of undeclared identifier
'cannot_convert_non_reference_arg_to_reference'
cannot_convert_non_reference_arg_to_reference);
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-matchers.h:548:7:
error: use of undeclared identifier
'conversion_of_arithmetic_types_must_be_lossless'
conversion_of_arithmetic_types_must_be_lossless);
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-matchers.h:683:25:
error: use of undeclared identifier
'matcher_and_value_have_different_numbers_of_fields'
matcher_and_value_have_different_numbers_of_fields);
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-matchers.h:1168:53:
error: use of undeclared identifier 'AnyEq'
class Eq2Matcher : public PairMatchBase<Eq2Matcher, AnyEq> {
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-matchers.h:1172:53:
error: use of undeclared identifier 'AnyNe'
class Ne2Matcher : public PairMatchBase<Ne2Matcher, AnyNe> {
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-matchers.h:1176:53:
error: use of undeclared identifier 'AnyLt'
class Lt2Matcher : public PairMatchBase<Lt2Matcher, AnyLt> {
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-matchers.h:1180:53:
error: use of undeclared identifier 'AnyGt'
class Gt2Matcher : public PairMatchBase<Gt2Matcher, AnyGt> {
^
/Users/pauln/git/arrow/cpp/session-management-build-debug-flight-sql/_deps/googletest-src/googlemock/include/gmock/gmock-matchers.h:1184:53:
error: use of undeclared identifier 'AnyLe'
class Le2Matcher : public PairMatchBase<Le2Matcher, AnyLe> {
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
[2/611] Performing build step for 'jemalloc_ep'
ninja: build stopped: subcommand failed.
```
It appears to include the correct parent search paths for the gtest/* and
gmock/* so I'm not clear on what's going off the rails where to allow the
system headers to break things as above.
### Component(s)
C++
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]