facebook / pyre2

Python wrapper for RE2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot build on newer versions of absl

PythonCoderAS opened this issue · comments

After June 2022, ABSL no longer supports c++11, so it cannot build anymore.

When I try manually upping the C++ stdlib version, I get these errors (on MacOS 13):

Command used: clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -I/usr/local/include -I/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c _re2.cc -o _re2.o -std=c++14

In file included from _re2.cc:37:
In file included from /usr/local/include/re2/re2.h:219:
In file included from /usr/local/include/absl/types/optional.h:39:
/usr/local/include/absl/utility/utility.h:164:12: error: no member named 'in_place_t' in namespace 'std'
using std::in_place_t;
      ~~~~~^
/usr/local/include/absl/utility/utility.h:165:12: error: no member named 'in_place' in namespace 'std'
using std::in_place;
      ~~~~~^
/usr/local/include/absl/utility/utility.h:181:12: error: no member named 'in_place_type' in namespace 'std'
using std::in_place_type;
      ~~~~~^
/usr/local/include/absl/utility/utility.h:182:12: error: no member named 'in_place_type_t' in namespace 'std'
using std::in_place_type_t;
      ~~~~~^
/usr/local/include/absl/utility/utility.h:198:12: error: no member named 'in_place_index' in namespace 'std'
using std::in_place_index;
      ~~~~~^
/usr/local/include/absl/utility/utility.h:199:12: error: no member named 'in_place_index_t' in namespace 'std'
using std::in_place_index_t;
      ~~~~~^
In file included from _re2.cc:37:
In file included from /usr/local/include/re2/re2.h:219:
/usr/local/include/absl/types/optional.h:48:12: error: no member named 'optional' in namespace 'std'
using std::optional;
      ~~~~~^
/usr/local/include/absl/types/optional.h:49:12: error: no member named 'make_optional' in namespace 'std'
using std::make_optional;
      ~~~~~^
/usr/local/include/absl/types/optional.h:50:12: error: no member named 'nullopt_t' in namespace 'std'; did you mean 'nullptr_t'?
using std::nullopt_t;
      ~~~~~^~~~~~~~~
           nullptr_t
/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/c++/v1/cstddef:50:9: note: 'nullptr_t' declared here
using ::nullptr_t;
        ^
In file included from _re2.cc:37:
In file included from /usr/local/include/re2/re2.h:219:
/usr/local/include/absl/types/optional.h:51:12: error: no member named 'nullopt' in namespace 'std'
using std::nullopt;
      ~~~~~^
In file included from _re2.cc:37:
/usr/local/include/re2/re2.h:835:46: error: no member named 'optional' in namespace 'absl'
template <typename T> struct Parse3ary<absl::optional<T>> : public Parse3ary<T> {};
                                       ~~~~~~^
/usr/local/include/re2/re2.h:835:55: error: 'T' does not refer to a value
template <typename T> struct Parse3ary<absl::optional<T>> : public Parse3ary<T> {};
                                                      ^
/usr/local/include/re2/re2.h:835:20: note: declared here
template <typename T> struct Parse3ary<absl::optional<T>> : public Parse3ary<T> {};
                   ^
/usr/local/include/re2/re2.h:835:57: error: expected unqualified-id
template <typename T> struct Parse3ary<absl::optional<T>> : public Parse3ary<T> {};
                                                        ^
/usr/local/include/re2/re2.h:836:46: error: no member named 'optional' in namespace 'absl'
template <typename T> struct Parse4ary<absl::optional<T>> : public Parse4ary<T> {};
                                       ~~~~~~^
/usr/local/include/re2/re2.h:836:55: error: 'T' does not refer to a value
template <typename T> struct Parse4ary<absl::optional<T>> : public Parse4ary<T> {};
                                                      ^
/usr/local/include/re2/re2.h:836:20: note: declared here
template <typename T> struct Parse4ary<absl::optional<T>> : public Parse4ary<T> {};
                   ^
/usr/local/include/re2/re2.h:836:57: error: expected unqualified-id
template <typename T> struct Parse4ary<absl::optional<T>> : public Parse4ary<T> {};
                                                        ^
/usr/local/include/re2/re2.h:839:45: error: no template named 'optional' in namespace 'absl'
bool Parse(const char* str, size_t n, absl::optional<T>* dest) {
                                      ~~~~~~^
/usr/local/include/re2/re2.h:855:45: error: no template named 'optional' in namespace 'absl'
bool Parse(const char* str, size_t n, absl::optional<T>* dest, int radix) {
                                      ~~~~~~^
_re2.cc:211:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
  PyObject_HEAD_INIT(NULL)
  ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:81:5: note: expanded from macro 'PyObject_HEAD_INIT'
    1, type },
    ^~~~~~~
_re2.cc:255:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
  PyObject_HEAD_INIT(NULL)
  ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:81:5: note: expanded from macro 'PyObject_HEAD_INIT'
    1, type },
    ^~~~~~~
_re2.cc:299:3: warning: suggest braces around initialization of subobject [-Wmissing-braces]
  PyObject_HEAD_INIT(NULL)
  ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/opt/python@3.11/Frameworks/Python.framework/Versions/3.11/include/python3.11/object.h:81:5: note: expanded from macro 'PyObject_HEAD_INIT'
    1, type },
    ^~~~~~~
3 warnings and 18 errors generated.

I fixed this by going up to c++17.