velox: Build failure using Clang 13.1.6 due to googletest submodule

I am trying to build prestosql/tests/ArithmeticTest.cpp on my Mac with Clang 13.1.6 and it fails with the following error. This was also reported here. https://github.com/facebookincubator/velox/issues/1286#issuecomment-1086595439 Essentially, -Werror is set by default and warnings are erroring out. The fix for this is merged in googletest commit https://github.com/google/googletest/commit/f7902802f1a61140e188223fb6d1c95925cbec4a

In file included from /Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/src/gmock-all.cc:39:
In file included from /Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock.h:59:
/Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-actions.h:455:3: error: definition of implicit copy constructor for 'PolymorphicAction<testing::internal::ReturnNullAction>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
  ^
/usr/local/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-actions.h:1011:10: note: in implicit copy constructor for 'testing::PolymorphicAction<testing::internal::ReturnNullAction>' first required here
  return MakePolymorphicAction(internal::ReturnNullAction());
         ^
/Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-actions.h:455:3: error: definition of implicit copy constructor for 'PolymorphicAction<testing::internal::ReturnVoidAction>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
  ^
/usr/local/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-actions.h:1016:10: note: in implicit copy constructor for 'testing::PolymorphicAction<testing::internal::ReturnVoidAction>' first required here
  return MakePolymorphicAction(internal::ReturnVoidAction());
         ^
In file included from /Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/src/gmock-all.cc:39:
In file included from /Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock.h:61:
In file included from /Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-function-mocker.h:39:
In file included from /Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h:47:
In file included from /Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-spec-builders.h:75:
/Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-matchers.h:1506:3: error: definition of implicit copy constructor for 'FloatingEqMatcher<double>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);
  ^
/usr/local/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-matchers.h:3632:10: note: in implicit copy constructor for 'testing::internal::FloatingEqMatcher<double>' first required here
  return internal::FloatingEqMatcher<double>(rhs, false);
         ^
/Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-matchers.h:1506:3: error: definition of implicit copy constructor for 'FloatingEqMatcher<float>' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
  GTEST_DISALLOW_ASSIGN_(FloatingEqMatcher);
  ^
/usr/local/include/gtest/internal/gtest-port.h:682:8: note: expanded from macro 'GTEST_DISALLOW_ASSIGN_'
  void operator=(type const &) = delete
       ^
/Users/deepak/workspace/ahana/velox/third_party/googletest/googlemock/include/gmock/gmock-matchers.h:3660:10: note: in implicit copy constructor for 'testing::internal::FloatingEqMatcher<float>' first required here
  return internal::FloatingEqMatcher<float>(rhs, false);

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (10 by maintainers)

Most upvoted comments

FYI, Also I believe theres a bug in our build scripts that makes it look into /usr/local instead of using submodule provided. Will look into that too.

Hi , @majetideepak , I will work on porting gtest along with other and future dependencies to ExternalProject_Add which will first look for external deps and then fallback to our specified submodules should they fail to exist.

non-existent path “/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include” I was able to resolve this by creating a symlink from MacOSX12.3.sdk to MacOSX12.1.sdk

@Nayef211 A clean build by deleting the build directory should resolve this. No need to create the symlink.

@kagamiori thanks for taking the time to check this. I am still seeing this. Let’s keep it open to see if anybody else is hitting this.

Thanks! I am seeing same issue on my side as well while compiling latest main of TorchArrow. cc: @wenleix, @kgpai

Also, my SDK version is 12.3

Hi, @mbasmanova I also encountered the same error in my workspace. And I found that

// CMakeLists.txt
find_package(
  Boost
  ...
  atomic)
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})

${Boost_INCLUDE_DIRS} = ‘/usr/local/include’ It make compile command for gtest like

  g++ ... -I{gmock_include_path} -isystem /usr/local/include ... -isystem ${real_gtest_include_path} ...

I hope this may help.

@majetideepak Deepak, I now remember that I also had to mode/delete the gtest headers from /usr/local/include as these were used instead of the one in the submodule. @Nayef211 @parmeet Is this something you could try as a workaround.

This worked for me @mbasmanova! I also ran into the following error after the recent MacOS update coming from third party libraries

non-existent path "/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include"

I was able to resolve this by creating a symlink from MacOSX12.3.sdk to MacOSX12.1.sdk

@majetideepak Deepak, I now remember that I also had to mode/delete the gtest headers from /usr/local/include as these were used instead of the one in the submodule. @Nayef211 @parmeet Is this something you could try as a workaround.

@kgpai Krishna, let’s look into why we are using the headers from the “wrong” location.

@kagamiori thanks for taking the time to check this. I am still seeing this. Let’s keep it open to see if anybody else is hitting this.