arybo
arybo copied to clipboard
error: invalid use of incomplete type 'PyFrameObject' {aka 'struct _frame'}
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
I don't believe it supports Python 3.11 yet. Try on 3.9 and you should be fine
just replace the bundled pybind11 in pytanque with latest pybind11 release and it will compile