piwheels / packages

Issue tracker for piwheels package issues
https://github.com/piwheels/packages/issues
20 stars 5 forks source link

simplejpeg built against too new numpy #212

Closed jfolz closed 1 year ago

jfolz commented 3 years ago

Package name: simplejpeg Link to PyPI page: https://pypi.org/project/simplejpeg/ Link to piwheels page: https://www.piwheels.org/project/simplejpeg/ Version: 1.6.1 Python version: at least 3.7, but probably all I am the maintainer: Yes More information:

With 1.6.1 simplejpeg conforms to PEP517 and is specified to build against oldest-supported-numpy. Here's the pyproject.toml:

[build-system]
requires = ["setuptools>=50.0.3", "wheel", "cmake>=3.6.3", "cython==0.29.23", "oldest-supported-numpy"]
build-backend = "setuptools.build_meta"

oldest-supported-numpy is a meta package that requires the oldest version of numpy that works with the current Python version:

[build-system]
requires = [
    "wheel",
    "setuptools",
    "numpy==1.13.3; python_version=='3.5'",
    "numpy==1.13.3; python_version=='3.6'",
    "numpy==1.14.5; python_version=='3.7'",
    # more numpy requirements...
]

From the looks of things the shown versions are available from piwheels.

piwheels seems to not respect this requirement:

pip install numpy==1.19.5
pip install simplejpeg==1.6.1
python3 -c "import simplejpeg; print(simplejpeg.__version__)"

This results in ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 44 from C header, got 40 from PyObject.

pip install numpy==1.20.0
python3 -c "import simplejpeg; print(simplejpeg.__version__)"
1.6.1

As you can see it only works with 1.20.0 since the size of ndarray changed, so I believe piwheels built against numpy>=1.20 instead of oldest-supported-numpy.

bennuttall commented 3 years ago

This is the end of the build output: https://paste.debian.net/1199603/

We provision the builders with apt's numpy (1.16.2 in Buster) and also let pip upgrade it. I'm not sure how build requirements work with pre-installed packages?

jfolz commented 3 years ago

At the top we can see numpy==1.14.5 being installed, which is correct. My understanding is that pip is supposed to provide an isolated build environment (through pep517, in this case vendored into pip). That is the default when a PEP 517-compatible distribution is detected and has to be turned off with --no-build-isolation. The isolation is clearly not working here as the build is referencing files in /usr/local/lib/python3.7/dist-packages/numpy instead of some temp directory.

jfolz commented 1 year ago

I don't see the issue in recent builds. Closing.