arybo icon indicating copy to clipboard operation
arybo copied to clipboard

error: invalid use of incomplete type 'PyFrameObject' {aka 'struct _frame'}

Open barracuda156 opened this issue 3 years ago • 2 comments

Python bindings fail on macOS with gcc12:

:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_libpetanque/libpetanque/work/arybo-1.1.0/petanque/third-party/pybind11/cast.h: In function 'std::string pybind11::detail::error_string()':
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_libpetanque/libpetanque/work/arybo-1.1.0/petanque/third-party/pybind11/cast.h:442:36: error: invalid use of incomplete type 'PyFrameObject' {aka 'struct _frame'}
:info:build   442 |                 "  " + handle(frame->f_code->co_filename).cast<std::string>() +
:info:build       |                                    ^~
:info:build In file included from /opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/Python.h:42:
:info:build /opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of 'PyFrameObject' {aka 'struct _frame'}
:info:build    22 | typedef struct _frame PyFrameObject;
:info:build       |                ^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_libpetanque/libpetanque/work/arybo-1.1.0/petanque/third-party/pybind11/cast.h:442:75: error: expected primary-expression before '>' token
:info:build   442 |                 "  " + handle(frame->f_code->co_filename).cast<std::string>() +
:info:build       |                                                                           ^
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_libpetanque/libpetanque/work/arybo-1.1.0/petanque/third-party/pybind11/cast.h:442:77: error: expected primary-expression before ')' token
:info:build   442 |                 "  " + handle(frame->f_code->co_filename).cast<std::string>() +
:info:build       |                                                                             ^
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_libpetanque/libpetanque/work/arybo-1.1.0/petanque/third-party/pybind11/cast.h:444:29: error: invalid use of incomplete type 'PyFrameObject' {aka 'struct _frame'}
:info:build   444 |                 handle(frame->f_code->co_name).cast<std::string>() + "\n";
:info:build       |                             ^~
:info:build /opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of 'PyFrameObject' {aka 'struct _frame'}
:info:build    22 | typedef struct _frame PyFrameObject;
:info:build       |                ^~~~~~
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_libpetanque/libpetanque/work/arybo-1.1.0/petanque/third-party/pybind11/cast.h:444:64: error: expected primary-expression before '>' token
:info:build   444 |                 handle(frame->f_code->co_name).cast<std::string>() + "\n";
:info:build       |                                                                ^
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_libpetanque/libpetanque/work/arybo-1.1.0/petanque/third-party/pybind11/cast.h:444:66: error: expected primary-expression before ')' token
:info:build   444 |                 handle(frame->f_code->co_name).cast<std::string>() + "\n";
:info:build       |                                                                  ^
:info:build /opt/local/var/macports/build/_opt_PPCRosettaPorts_math_libpetanque/libpetanque/work/arybo-1.1.0/petanque/third-party/pybind11/cast.h:445:26: error: invalid use of incomplete type 'PyFrameObject' {aka 'struct _frame'}
:info:build   445 |             frame = frame->f_back;
:info:build       |                          ^~
:info:build /opt/local/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11/pytypedefs.h:22:16: note: forward declaration of 'PyFrameObject' {aka 'struct _frame'}
:info:build    22 | typedef struct _frame PyFrameObject;
:info:build       |                ^~~~~~

Without Python bindings the library builds fine and all tests pass: https://github.com/macports/macports-ports/pull/17103

barracuda156 avatar Dec 29 '22 02:12 barracuda156

I don't believe it supports Python 3.11 yet. Try on 3.9 and you should be fine

0xTowel avatar Apr 18 '23 01:04 0xTowel

just replace the bundled pybind11 in pytanque with latest pybind11 release and it will compile

TsXor avatar Dec 04 '23 07:12 TsXor