View Issue Details

IDProjectCategoryView StatusLast Update
0004143FreeCADBugpublic2019-10-20 15:11
Reporterhobbes1069 Assigned Towmayer  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformLinuxOSFedoraOS Version32 (Rawhide)
Product Version0.18 
Target VersionFixed in Version0.19 
Summary0004143: Build error on Fedora with Python 3.8
DescriptionPer the discussion on another Fedora issue:

https://www.freecadweb.org/tracker/view.php?id=4132#c13672

It looks like something to do with thread management was changed in Python 3.8 which is incompatible with current freecad code.


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;
      |        ^~~
Steps To ReproduceAttempt to build FreeCAD 0.18.3 with Fedora Rawhide (32) which has Python 3.8
Tagspython
FreeCAD Information

Activities

hobbes1069

2019-09-24 20:59

reporter   ~0013685

Looks like PyInterpreterState was effectively made private. Temporary workaround suggested here:

https://bugs.python.org/issue35886

hobbes1069

2019-10-17 16:23

reporter   ~0013764

I implemented this fix for Fedora...

Replace "interp->modules" with PyImport_GetModuleDict()

Pull request submitted:

https://github.com/FreeCAD/FreeCAD/pull/2632

Kunda1

2019-10-20 15:09

administrator   ~0013769

Thanks hobbes1069 for the fix!

side note: hmm wonder why merging the PR didn't auto close this issue.
FreeCAD master 6eacb17b
I'll do it manually.

Related Changesets

FreeCAD: master 6eacb17b

2019-10-17 16:20:10

hobbes1069


Committer: wwmayer Details Diff
Update swigpyrun.in for Python 3.8

In Python 3.8 some functions related to thread state were intentionally made private.

This fix (specific to FreeCAD) was suggested here:

https://bugs.python.org/issue35886
Affected Issues
0004143
mod - src/Base/swigpyrun.inl Diff File

Issue History

Date Modified Username Field Change
2019-09-24 12:49 hobbes1069 New Issue
2019-09-24 20:59 hobbes1069 Note Added: 0013685
2019-10-10 18:27 Kunda1 Tag Attached: python
2019-10-17 16:23 hobbes1069 Note Added: 0013764
2019-10-20 15:09 Kunda1 Note Added: 0013769
2019-10-20 15:09 Kunda1 Changeset attached => FreeCAD master 6eacb17b
2019-10-20 15:10 Kunda1 Fixed in Version => 0.19
2019-10-20 15:11 Kunda1 Assigned To => wmayer
2019-10-20 15:11 Kunda1 Status new => closed
2019-10-20 15:11 Kunda1 Resolution open => fixed