facebook / watchman

Watches files and records, or triggers actions, when they change.
https://facebook.github.io/watchman/
MIT License
12.72k stars 994 forks source link

Build failure on macOS with 2021.07.12.00 #930

Closed carlocab closed 3 years ago

carlocab commented 3 years ago

We're trying to update Homebrew's version of watchman at Homebrew/homebrew-core#80732, built against folly 2021.06.28.00 (which fixes the failure reported in #916).

The build fails with errors starting with

In file included from /tmp/watchman-20210717-74521-1gm63te/watchman-2021.07.12.00/watchman/tests/PendingCollectionTest.cpp:4:
In file included from /tmp/watchman-20210717-74521-1gm63te/watchman-2021.07.12.00/watchman/PendingCollection.h:10:
/tmp/watchman-20210717-74521-1gm63te/watchman-2021.07.12.00/watchman/watchman_string.h:114:16: error: no member named 'data' in 'watchman_pending_fs'
      : s_(str.data()), e_(str.data() + str.size()) {}
           ~~~ ^
/usr/local/include/gtest/gtest-printers.h:215:12: note: in instantiation of function template specialization 'w_string_piece::w_string_piece<watchman_pending_fs, 0>' requested here
    *os << value;
           ^
/usr/local/include/gtest/gtest-printers.h:312:12: note: in instantiation of function template specialization 'testing::internal::internal_stream_operator_without_lexical_name_lookup::StreamPrinter::PrintValue<watchman_pending_fs, void, std::__1::basic_ostream<char> &>' requested here
  Printer::PrintValue(value, os);
           ^
/usr/local/include/gtest/gtest-printers.h:441:13: note: in instantiation of function template specialization 'testing::internal::PrintWithFallback<watchman_pending_fs>' requested here
  internal::PrintWithFallback(value, os);
            ^
/usr/local/include/gtest/gtest-printers.h:691:5: note: in instantiation of function template specialization 'testing::internal::PrintTo<watchman_pending_fs>' requested here
    PrintTo(value, os);
    ^
/usr/local/include/gtest/gtest-printers.h:617:26: note: in instantiation of member function 'testing::internal::UniversalPrinter<watchman_pending_fs>::Print' requested here
    UniversalPrinter<T>::Print(*ptr, os);
                         ^

This occurs on macOS Mojave, Catalina and Big Sur (ARM and Intel).

Build logs available at https://github.com/Homebrew/homebrew-core/actions/runs/1040595867 and the error on Catalina starts at https://github.com/Homebrew/homebrew-core/pull/80732/checks?check_run_id=3093768144#step:7:387.

Assistance would be appreciated. Thanks.

carlocab commented 3 years ago

It turns out this was because we were using googletest 1.11. Building with googletest 1.10 fixed the errors referenced above.