MagicStack / httptools

Fast HTTP parser
MIT License
1.21k stars 83 forks source link

Doesn't build against Python 3.11 #79

Closed dimaqq closed 2 years ago

dimaqq commented 2 years ago
        running build_ext
        building 'httptools.parser.parser' extension
        creating build/temp.linux-x86_64-3.11
        creating build/temp.linux-x86_64-3.11/httptools
        creating build/temp.linux-x86_64-3.11/httptools/parser
        creating build/temp.linux-x86_64-3.11/vendor
        creating build/temp.linux-x86_64-3.11/vendor/llhttp
        creating build/temp.linux-x86_64-3.11/vendor/llhttp/src
        x86_64-linux-gnu-gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/tmp/pip-req-build-cyh4gi6y/vendor/llhttp/include -I/tmp/pip-req-build-cyh4gi6y/vendor/llhttp/src -I/home/dima/.cache/pypoetry/virtualenvs/silly-chat-9D3wOO4G-py3.11/include -I/usr/include/python3.11 -c httptools/parser/parser.c -o build/temp.linux-x86_64-3.11/httptools/parser/parser.o -O2
        httptools/parser/parser.c: In function ‘__pyx_pf_9httptools_6parser_6parser_10HttpParser_10feed_data’:
        httptools/parser/parser.c:3452:23: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
         3452 |       __pyx_v_err_pos = llhttp_get_error_pos(__pyx_v_self->_cparser);
              |                       ^
        httptools/parser/parser.c: In function ‘__Pyx_AddTraceback’:
        httptools/parser/parser.c:454:62: error: dereferencing pointer to incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
          454 |   #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
              |                                                              ^~
        httptools/parser/parser.c:9421:5: note: in expansion of macro ‘__Pyx_PyFrame_SetLineNumber’
         9421 |     __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
              |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
        error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
        [end of output]
belm0 commented 2 years ago

workaround: install a recent version of cython, and build from source

pip install --upgrade cython
pip install git+https://github.com/MagicStack/httptools.git@v0.4.0
edmorley commented 2 years ago

This appears to be resolved as of #84?

dimaqq commented 2 years ago

Having a glance at the PR, yes, the issue ought to be resolved in the main branch.