Created attachment 117532 [details]
Move node_class to the module globals so it can be pickled.
In Debian/Ubuntu, we are building py3cairo 1.10.0. With the transition to Python 3.5 currently ongoing in Ubuntu, a build failure has surfaced which actually affects Python 3.4 and 3.5, although we've only just noticed it.
The problem is that in waflib/Context.py, the Context class has a node_class nested inside the __init__.py. Inside the __init__() it assigns this class to the self.node_class attribute. The build process attempts to pickle the Context instance, but this nested class breaks that because it cannot be pickled. Python cannot pickle classes which are nested inside methods because they cannot be unpickled; Python can't look up the class when it comes to unpickling it. I'm rather surprised this ever built correctly.
The fix I'm applying for Ubuntu (and eventually Debian) is rather simple. There's no obvious reason why node_class has to be nested inside __init__(), so I just moved it to being a module global.
See attached patch.
For some reason which I don't yet understand, this patch only fixed the py3cairo build on some, but not all platforms.
It looks like we're still getting similar failures for arm64, powerpc, and ppc64el:
I clearly have to better understand why this pickling is done, and why it would be different on different platform builds.
If you can provide insights, please get in touch!
This patch probably doesn't work correctly anyway. After much pdb'ing I still don't understand how this is failing.
This appears to be a duplicate of bug 76759. Probably both don't need to be open.
Since 1.11 pycairo uses distutils for building. If there are any problems with the new system please file a bug: https://github.com/pygobject/pycairo/issues
*** This bug has been marked as a duplicate of bug 76759 ***