andreasvc / pyre2

Python wrapper for RE2
BSD 3-Clause "New" or "Revised" License
99 stars 33 forks source link

Build fails with Python 3.7.0 #10

Closed ivan closed 6 years ago

ivan commented 6 years ago
# ~/ds-venv/bin/pip install re2   
Collecting re2
  Downloading https://files.pythonhosted.org/packages/1d/93/17606ff043e3c27cfd50561b906142de1a8debeb958a3ab4226ca66d195e/re2-0.2.22.tar.gz (1.9MB)
    100% |████████████████████████████████| 1.9MB 24.1MB/s 
Installing collected packages: re2
  Running setup.py install for re2 ... error
    Complete output from command /home/grab/ds-venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dhg3zzna/re2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-8wgk9u0f/install-record.txt --single-version-externally-managed --compile --install-headers /home/grab/ds-venv/include/site/python3.7/re2:
    running install
    running build
    running build_ext
    building 're2' extension
    creating build
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/src
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include -I/home/grab/ds-venv/include -I/home/grab/.pyenv/versions/3.7.0/include/python3.7m -c src/re2.cpp -o build/temp.linux-x86_64-3.7/src/re2.o
    src/re2.cpp: In function ‘PyObject* __pyx_f_3re2_unicode_to_bytestring(PyObject*, int*)’:
    src/re2.cpp:1429:17: warning: ‘PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE*, Py_ssize_t, const char*)’ is deprecated [-Wdeprecated-declarations]
         __pyx_t_2 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(__pyx_v_pystring), PyUnicode_GET_SIZE(__pyx_v_pystring), __pyx_k__strict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                     ^~~~~~~~~~~~~~~~~~~~
    In file included from /home/grab/.pyenv/versions/3.7.0/include/python3.7m/Python.h:80:0,
                     from src/re2.cpp:4:
    /home/grab/.pyenv/versions/3.7.0/include/python3.7m/unicodeobject.h:1320:23: note: declared here
     PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
                           ^~~~~~~~~~~~~~~~~~~~
    src/re2.cpp:1429:131: warning: ‘PyObject* PyUnicode_EncodeUTF8(const Py_UNICODE*, Py_ssize_t, const char*)’ is deprecated [-Wdeprecated-declarations]
         __pyx_t_2 = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(__pyx_v_pystring), PyUnicode_GET_SIZE(__pyx_v_pystring), __pyx_k__strict); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
                                                                                                                                       ^
    In file included from /home/grab/.pyenv/versions/3.7.0/include/python3.7m/Python.h:80:0,
                     from src/re2.cpp:4:
    /home/grab/.pyenv/versions/3.7.0/include/python3.7m/unicodeobject.h:1320:23: note: declared here
     PyAPI_FUNC(PyObject*) PyUnicode_EncodeUTF8(
                           ^~~~~~~~~~~~~~~~~~~~
    src/re2.cpp: In function ‘int __pyx_f_3re2_pystring_to_bytestring(PyObject*, char**, Py_ssize_t*)’:
    src/re2.cpp:1502:13: warning: ‘int PyObject_AsCharBuffer(PyObject*, const char**, Py_ssize_t*)’ is deprecated [-Wdeprecated-declarations]
       __pyx_r = PyObject_AsCharBuffer(__pyx_v_pystring, ((const char* *)__pyx_v_cstring), __pyx_v_length);
                 ^~~~~~~~~~~~~~~~~~~~~
    In file included from /home/grab/.pyenv/versions/3.7.0/include/python3.7m/Python.h:128:0,
                     from src/re2.cpp:4:
    /home/grab/.pyenv/versions/3.7.0/include/python3.7m/abstract.h:471:17: note: declared here
     PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
                     ^~~~~~~~~~~~~~~~~~~~~
    src/re2.cpp:1502:101: warning: ‘int PyObject_AsCharBuffer(PyObject*, const char**, Py_ssize_t*)’ is deprecated [-Wdeprecated-declarations]
       __pyx_r = PyObject_AsCharBuffer(__pyx_v_pystring, ((const char* *)__pyx_v_cstring), __pyx_v_length);
                                                                                                         ^
    In file included from /home/grab/.pyenv/versions/3.7.0/include/python3.7m/Python.h:128:0,
                     from src/re2.cpp:4:
    /home/grab/.pyenv/versions/3.7.0/include/python3.7m/abstract.h:471:17: note: declared here
     PyAPI_FUNC(int) PyObject_AsCharBuffer(PyObject *obj,
                     ^~~~~~~~~~~~~~~~~~~~~
    src/re2.cpp: In function ‘PyObject* __pyx_pf_3re2_7Pattern_split(PyObject*, PyObject*, PyObject*)’:
    src/re2.cpp:6410:7: warning: variable ‘__pyx_v_num_groups’ set but not used [-Wunused-but-set-variable]
       int __pyx_v_num_groups;
           ^~~~~~~~~~~~~~~~~~
    src/re2.cpp: In function ‘PyObject* __pyx_pf_3re2_7Pattern_subn(PyObject*, PyObject*, PyObject*)’:
    src/re2.cpp:7285:7: warning: variable ‘__pyx_v_encoded’ set but not used [-Wunused-but-set-variable]
       int __pyx_v_encoded;
           ^~~~~~~~~~~~~~~
    src/re2.cpp: In function ‘PyObject* PyInit_re2()’:
    src/re2.cpp:13638:14: warning: variable ‘__pyx_t_6’ set but not used [-Wunused-but-set-variable]
       Py_ssize_t __pyx_t_6;
                  ^~~~~~~~~
    src/re2.cpp: In function ‘int __Pyx_GetException(PyObject**, PyObject**, PyObject**)’:
    src/re2.cpp:14764:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tmp_type = tstate->exc_type;
                            ^~~~~~~~
    src/re2.cpp:14765:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tmp_value = tstate->exc_value;
                             ^~~~~~~~~
    src/re2.cpp:14766:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tmp_tb = tstate->exc_traceback;
                          ^~~~~~~~~~~~~
    src/re2.cpp:14767:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tstate->exc_type = local_type;
                 ^~~~~~~~
    src/re2.cpp:14768:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tstate->exc_value = local_value;
                 ^~~~~~~~~
    src/re2.cpp:14769:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tstate->exc_traceback = local_tb;
                 ^~~~~~~~~~~~~
    src/re2.cpp: In function ‘void __Pyx_ExceptionSave(PyObject**, PyObject**, PyObject**)’:
    src/re2.cpp:14790:21: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
         *type = tstate->exc_type;
                         ^~~~~~~~
    src/re2.cpp:14791:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
         *value = tstate->exc_value;
                          ^~~~~~~~~
    src/re2.cpp:14792:19: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         *tb = tstate->exc_traceback;
                       ^~~~~~~~~~~~~
    src/re2.cpp: In function ‘void __Pyx_ExceptionReset(PyObject*, PyObject*, PyObject*)’:
    src/re2.cpp:14801:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tmp_type = tstate->exc_type;
                            ^~~~~~~~
    src/re2.cpp:14802:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tmp_value = tstate->exc_value;
                             ^~~~~~~~~
    src/re2.cpp:14803:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tmp_tb = tstate->exc_traceback;
                          ^~~~~~~~~~~~~
    src/re2.cpp:14804:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tstate->exc_type = type;
                 ^~~~~~~~
    src/re2.cpp:14805:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tstate->exc_value = value;
                 ^~~~~~~~~
    src/re2.cpp:14806:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tstate->exc_traceback = tb;
                 ^~~~~~~~~~~~~
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/home/grab/ds-venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-dhg3zzna/re2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-8wgk9u0f/install-record.txt --single-version-externally-managed --compile --install-headers /home/grab/ds-venv/include/site/python3.7/re2" failed with error code 1 in /tmp/pip-install-dhg3zzna/re2/
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
andreasvc commented 6 years ago

That's due to the following Cython bug: https://github.com/cython/cython/issues/1955

Make sure you're running the latest Cython version.

ivan commented 6 years ago

Thanks. I had the latest Cython installed, but I screwed up by assuming that re2 in PyPI matched your repo, and I should have read your README more closely. It's working fine now.