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

MacOS: fails to compile test #588

Closed
mouse07410 opened this issue Feb 27, 2020 · 2 comments · Fixed by #589
Closed

MacOS: fails to compile test #588

mouse07410 opened this issue Feb 27, 2020 · 2 comments · Fixed by #589

Comments

@mouse07410
Copy link

MacOS Catalina 10.15.3, Xcode-11.3.1, EncFS current master, Macports-installed gtest-1.10.0.

Here's the problem:

. . . . .
[100%] Linking CXX executable checkops
[100%] Built target checkops
Scanning dependencies of target gtest
[  2%] Building CXX object vendor/github.com/google/googletest/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-all.cc:42:
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest.cc:142:
/Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-internal-inl.h:429:11: error: 
      unknown type name 'string'; did you mean 'String'?
  virtual string CurrentStackTrace(int max_depth, int skip_count) = 0;
          ^~~~~~
          String
/opt/local/include/gtest/internal/gtest-string.h:58:18: note: 'String' declared here
class GTEST_API_ String {
                 ^
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-all.cc:42:
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest.cc:142:
/Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-internal-inl.h:449:11: error: 
      unknown type name 'string'; did you mean 'String'?
  virtual string CurrentStackTrace(int max_depth, int skip_count);
          ^~~~~~
          String
/opt/local/include/gtest/internal/gtest-string.h:58:18: note: 'String' declared here
class GTEST_API_ String {
                 ^
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-all.cc:42:
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest.cc:142:
/Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-internal-inl.h:635:25: error: 
      no type named 'SetUpTestCaseFunc' in 'testing::Test'; did you mean
      'SetUpTestSuiteFunc'?
                        Test::SetUpTestCaseFunc set_up_tc,
                        ^~~~~~~~~~~~~~~~~~~~~~~
                        SetUpTestSuiteFunc
/opt/local/include/gtest/internal/gtest-internal.h:477:7: note: 'SetUpTestSuiteFunc'
      declared here
using SetUpTestSuiteFunc = void (*)();
      ^
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-all.cc:42:
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest.cc:142:
/Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-internal-inl.h:636:25: error: 
      no type named 'TearDownTestCaseFunc' in 'testing::Test'; did you mean
      'TearDownTestSuiteFunc'?
                        Test::TearDownTestCaseFunc tear_down_tc);
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~
                        TearDownTestSuiteFunc
/opt/local/include/gtest/internal/gtest-internal.h:478:7: note: 'TearDownTestSuiteFunc'
      declared here
using TearDownTestSuiteFunc = void (*)();
      ^
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-all.cc:42:
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest.cc:142:
/Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-internal-inl.h:645:20: error: 
      no type named 'SetUpTestCaseFunc' in 'testing::Test'; did you mean
      'SetUpTestSuiteFunc'?
  void AddTestInfo(Test::SetUpTestCaseFunc set_up_tc,
                   ^~~~~~~~~~~~~~~~~~~~~~~
                   SetUpTestSuiteFunc
. . . . .
In file included from /Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest-all.cc:42:
/Users/uri/src/encfs/vendor/github.com/google/googletest/googletest/src/gtest.cc:2508:7: error: 
      initializer 'test_case_name_' does not name a non-static data member or base class;
      did you mean the member 'test_suite_name_'?
    : test_case_name_(a_test_case_name),
      ^~~~~~~~~~~~~~~
      test_suite_name_
/opt/local/include/gtest/gtest.h:802:21: note: 'test_suite_name_' declared here
  const std::string test_suite_name_;    // test suite name
                    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[3]: *** [vendor/github.com/google/googletest/googlemock/gtest/CMakeFiles/gtest.dir/src/gtest-all.cc.o] Error 1
make[2]: *** [vendor/github.com/google/googletest/googlemock/gtest/CMakeFiles/gtest.dir/all] Error 2
make[1]: *** [test/CMakeFiles/unittests.dir/rule] Error 2
make: *** [unittests] Error 2

I need a way to either not build another gtest under EncFS (one already working that's installed in /opt/local is good enough, I assure you), or fix the build of gtest that EncFS insists on building by itself instead of relying on what's already installed on the target system.

@benrubson
Copy link
Contributor

Let's see if #589 helps, as a first step.

@mouse07410
Copy link
Author

#589 doesn't even merge:

. . . . .
Auto-merging vendor/github.com/google/benchmark/src/console_reporter.cc
CONFLICT (content): Merge conflict in vendor/github.com/google/benchmark/src/console_reporter.cc
Auto-merging vendor/github.com/google/benchmark/src/complexity.cc
Auto-merging vendor/github.com/google/benchmark/src/benchmark_register.cc
CONFLICT (content): Merge conflict in vendor/github.com/google/benchmark/src/benchmark_register.cc
Auto-merging vendor/github.com/google/benchmark/src/benchmark_api_internal.h
Auto-merging vendor/github.com/google/benchmark/src/benchmark.cc
CONFLICT (content): Merge conflict in vendor/github.com/google/benchmark/src/benchmark.cc
Removing vendor/github.com/google/benchmark/include/benchmark/benchmark_api.h
Auto-merging vendor/github.com/google/benchmark/include/benchmark/benchmark.h
CONFLICT (content): Merge conflict in vendor/github.com/google/benchmark/include/benchmark/benchmark.h
Auto-merging vendor/github.com/google/benchmark/cmake/CXXFeatureCheck.cmake
CONFLICT (content): Merge conflict in vendor/github.com/google/benchmark/cmake/CXXFeatureCheck.cmake
Auto-merging vendor/github.com/google/benchmark/cmake/AddCXXCompilerFlag.cmake
Auto-merging vendor/github.com/google/benchmark/README.md
CONFLICT (content): Merge conflict in vendor/github.com/google/benchmark/README.md
Auto-merging vendor/github.com/google/benchmark/CONTRIBUTORS
CONFLICT (content): Merge conflict in vendor/github.com/google/benchmark/CONTRIBUTORS
Auto-merging vendor/github.com/google/benchmark/CMakeLists.txt
Auto-merging vendor/github.com/google/benchmark/AUTHORS
CONFLICT (content): Merge conflict in vendor/github.com/google/benchmark/AUTHORS
Automatic merge failed; fix conflicts and then commit the result.

The cause of the problem seems to be the conflict between the installed gtest and the one EncFS insists on bringing in by itself. A nice solution IMHO would be to bring your own gtest only if the user asks to. There already are precedents - e.g., you aren't bringing your own OpenSSL, even though the Apple-native one is no good.

However, after sweating through the merge conflicts, the tests build and pass successfully.

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

Successfully merging a pull request may close this issue.

2 participants