I maintain FreeCAD for Fedora and there appears to have been a change in the API for how Python handles thread management in 3.8, specifically PyInterpreterState which is giving the the following error when trying to build FreeCAD:
In file included from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.cpp:41: /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.inl: In function 'void Swig_python::cleanupSWIG_T(const char*)': /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.inl:75:31: error: invalid use of incomplete type 'PyInterpreterState' {aka 'struct _is'} 75 | PyObject *modules = interp->modules; | ^~ In file included from /usr/include/python3.8/genobject.h:11, from /usr/include/python3.8/Python.h:121, from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/PyExport.h:42, from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.cpp:25: /usr/include/python3.8/pystate.h:20:8: note: forward declaration of 'PyInterpreterState' {aka 'struct _is'} 20 | struct _is; | ^~~
Any tips?
I can provide a full build log or setup a COPR but it's somewhat difficult since I'm building a whole new stack of some dependencies:
Coin3->Coin4 (in review) - Which SoQt, SIMVoleon, OpenSceneGraph and Pivy need to be ported to. Pyside->PySide2 (which implies Qt4->Qt5)
Thanks, Richard
Victor, do you know the answer here?
Blender has the same issue: https://bugzilla.redhat.com/show_bug.cgi?id=1734980 (but I forgot to CC you there)
On 2019-09-24 14:57, Richard Shaw wrote:
I maintain FreeCAD for Fedora and there appears to have been a change in the API for how Python handles thread management in 3.8, specifically PyInterpreterState which is giving the the following error when trying to build FreeCAD:
In file included from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.cpp:41: /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.inl: In function 'void Swig_python::cleanupSWIG_T(const char*)': /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.inl:75:31: error: invalid use of incomplete type 'PyInterpreterState' {aka 'struct _is'} 75 | PyObject *modules = interp->modules; | ^~ In file included from /usr/include/python3.8/genobject.h:11, from /usr/include/python3.8/Python.h:121, from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/PyExport.h:42, from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.cpp:25: /usr/include/python3.8/pystate.h:20:8: note: forward declaration of 'PyInterpreterState' {aka 'struct _is'} 20 | struct _is; | ^~~
Any tips?
I can provide a full build log or setup a COPR but it's somewhat difficult since I'm building a whole new stack of some dependencies:
Coin3->Coin4 (in review)
- Which SoQt, SIMVoleon, OpenSceneGraph and Pivy need to be ported to.
Pyside->PySide2 (which implies Qt4->Qt5)
Thanks, Richard
python-devel mailing list -- python-devel@lists.fedoraproject.org To unsubscribe send an email to python-devel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproje...
Hi,
It sounds like an issue in SWIG which access directly the PyInterpreterState structure which became opaque in Python 3.8.
SWIG should use PyImport_GetModuleDict() public function instead, to access PyImport_GetModuleDict(). In short, it returns interp->modules.
Victor
Le mar. 24 sept. 2019 à 14:57, Richard Shaw hobbes1069@gmail.com a écrit :
I maintain FreeCAD for Fedora and there appears to have been a change in the API for how Python handles thread management in 3.8, specifically PyInterpreterState which is giving the the following error when trying to build FreeCAD:
In file included from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.cpp:41: /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.inl: In function 'void Swig_python::cleanupSWIG_T(const char*)': /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.inl:75:31: error: invalid use of incomplete type 'PyInterpreterState' {aka 'struct _is'} 75 | PyObject *modules = interp->modules; | ^~ In file included from /usr/include/python3.8/genobject.h:11, from /usr/include/python3.8/Python.h:121, from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/PyExport.h:42, from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.cpp:25: /usr/include/python3.8/pystate.h:20:8: note: forward declaration of 'PyInterpreterState' {aka 'struct _is'} 20 | struct _is; | ^~~
Any tips?
I can provide a full build log or setup a COPR but it's somewhat difficult since I'm building a whole new stack of some dependencies:
Coin3->Coin4 (in review)
- Which SoQt, SIMVoleon, OpenSceneGraph and Pivy need to be ported to.
Pyside->PySide2 (which implies Qt4->Qt5)
Thanks, Richard _______________________________________________ python-devel mailing list -- python-devel@lists.fedoraproject.org To unsubscribe send an email to python-devel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproje...
Actually, this is in FreeCAD code:
FreeCAD-0.18.3/src/Base/swigpyrun.inl: PyObject *modules = interp->modules;
Change "interp->modules" to "PyImport_GetModuleDict()" there.
On 2019-09-24 16:33, Victor Stinner wrote:
Hi,
It sounds like an issue in SWIG which access directly the PyInterpreterState structure which became opaque in Python 3.8.
SWIG should use PyImport_GetModuleDict() public function instead, to access PyImport_GetModuleDict(). In short, it returns interp->modules.
Victor
Le mar. 24 sept. 2019 à 14:57, Richard Shaw hobbes1069@gmail.com a écrit :
I maintain FreeCAD for Fedora and there appears to have been a change in the API for how Python handles thread management in 3.8, specifically PyInterpreterState which is giving the the following error when trying to build FreeCAD:
In file included from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.cpp:41: /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.inl: In function 'void Swig_python::cleanupSWIG_T(const char*)': /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.inl:75:31: error: invalid use of incomplete type 'PyInterpreterState' {aka 'struct _is'} 75 | PyObject *modules = interp->modules; | ^~ In file included from /usr/include/python3.8/genobject.h:11, from /usr/include/python3.8/Python.h:121, from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/PyExport.h:42, from /builddir/build/BUILD/FreeCAD-0.18.3/src/Base/swigpyrun.cpp:25: /usr/include/python3.8/pystate.h:20:8: note: forward declaration of 'PyInterpreterState' {aka 'struct _is'} 20 | struct _is; | ^~~
Any tips?
I can provide a full build log or setup a COPR but it's somewhat difficult since I'm building a whole new stack of some dependencies:
Coin3->Coin4 (in review)
- Which SoQt, SIMVoleon, OpenSceneGraph and Pivy need to be ported to.
Pyside->PySide2 (which implies Qt4->Qt5)
Thanks, Richard _______________________________________________ python-devel mailing list -- python-devel@lists.fedoraproject.org To unsubscribe send an email to python-devel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproje...
python-devel mailing list -- python-devel@lists.fedoraproject.org To unsubscribe send an email to python-devel-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproje...
On Thu, Sep 26, 2019 at 3:55 AM Petr Viktorin pviktori@redhat.com wrote:
Actually, this is in FreeCAD code:
FreeCAD-0.18.3/src/Base/swigpyrun.inl: PyObject *modules = interp->modules;
Change "interp->modules" to "PyImport_GetModuleDict()" there.
Not being a c/c++ programmer I wasn't sure if it was literally that simple. :)
I'll give it a try.
Thanks, Richard
On 2019-09-26 14:03, Richard Shaw wrote:
On Thu, Sep 26, 2019 at 3:55 AM Petr Viktorin <pviktori@redhat.com mailto:pviktori@redhat.com> wrote:
Actually, this is in FreeCAD code: FreeCAD-0.18.3/src/Base/swigpyrun.inl: PyObject *modules = interp->modules; Change "interp->modules" to "PyImport_GetModuleDict()" there.
Not being a c/c++ programmer I wasn't sure if it was literally that simple. :)
I'll give it a try.
If it doesn't work, please share a COPR that runs into this error. I tried the change, but (as you warned) I ran into issues that didn't look Python-releated.
python-devel@lists.fedoraproject.org