Pip pre wheels break windows mayavi builds
I noticed this week that CI builds that use pip install --upgrade --pre vtk
started hanging (1 hour timeouts on this step):
Turning on a sort of debugging mode for the mayavi build and trying it locally on my Windows machine, I can replicate with winpty python setup.py develop
(winpty because I run from a Git bash terminal):
...
get instance <class 'vtkmodules.vtkCommonDataModel.vtkDataAssembly'>
got instance <class 'vtkmodules.vtkCommonDataModel.vtkDataAssembly'>
Get vtkDataAssembly Attribute
Get vtkDataAssembly NodeName
Get vtkDataAssembly RootNodeName
GC vtkDataAssembly
get instance <class 'vtkmodules.vtkIOCore.vtkDataCompressor'>
got instance <class 'vtkmodules.vtkIOCore.vtkLZ4DataCompressor'>
Get vtkDataCompressor CompressionLevel
GC vtkDataCompressor
get instance <class 'vtkmodules.vtkWebCore.vtkDataEncoder'>
got instance <class 'vtkmodules.vtkWebCore.vtkDataEncoder'>
Get vtkDataEncoder MaxThreads
At this point it hangs (i.e., when calling the GetMaxThreads method of vtkDataEncoder), and if I kill the terminal I get:
I understand the version being around, Mayavi uses it. The MultiThreader I'm guessing comes from the class and might be a problem? In any case, I can work around this by:
- Skipping both
vtkDataEncoder
andvtkWebApplication
(which will hang on itsGet vtkWebApplication NumberOfEncoderThreads
step). - Running with
python -u
So I'm not really sure what's going on here, but it seems like there is some problem with threading that can break things under some circumstances. I can work on boiling this down to some minimal example that doesn't rely on needing mayavi if it would help, but it'll probably take me a while. I'm hoping in the meantime someone will magically know what the problem is based on just the thread-relatedness and the error message window :)
Even after using the workarounds above, Mayavi plotting still doesn't work (it also hangs), but Qt-based plotting in PyVista does not, so I think that part at least might be Mayavi-specific.