I’ve got a conda-forge recipe for a complex sandwich of Python / Cython / C++
It’s been building for us locally for years, and we regularly use it on Windows, Linux and Mac platforms.
But when it’s built by conda-build with the conda-forge system (on conda-forge CI or with the build-locally.py
script) then it segfaults out on the test stage, with (at least one) or our tests.
Here’s the PR with the latest build config:
Note that it doesn’t fail with a simple import (which does import all (most?) of the extension modules.
But most weirdly, if I install the built package (either built locally with build-locally.py
or by grabbing the artifact from the CI) into a hand-built test environment, the tests run fine with no segfaults.
If I do it all locally with the build-locally.py
script, I can activate the test environment it creates, and that does produce the segfault.
At a glance the test environment looks the same, but apparently something is different.
What’s even weirder is that this behavior seems to be consistent across all three platforms (and four python versions…) – WTF?
It does appear to be tied to one Cython extension – so likely is a bug in our code (and not an issue with Python or numpy ABI compatibility) but how in the world can we debug it if we don’t get the failure on our regular systems / environments?
And again, this particular code hasn’t changed in many years, and is working fine on our development and production systems – so ???
Is there something special about the test environment that conda build creates that could explain this??
NOTE: we could simply de-activate those tests in the build setup – but I am very wary of a potential segfault! And the reason I added them in the first place is that the first time we did this, we accidentally shipped a broken Windows build – 'cause our Windows CI was broken, and it hasn’t been tested with that particular version of python and numpy. So running the test suite really is a good idea.