FS#57492 - [python-pillow] Pillow headers should not be (indiscriminately) installed to /usr/include/python3.6m
Attached to Project:
Community Packages
Opened by Antony Lee (anntzer) - Tuesday, 13 February 2018, 17:49 GMT
Last edited by Antonio Rojas (arojas) - Monday, 04 April 2022, 09:24 GMT
Opened by Antony Lee (anntzer) - Tuesday, 13 February 2018, 17:49 GMT
Last edited by Antonio Rojas (arojas) - Monday, 04 April 2022, 09:24 GMT
|
Details
Description:
Currently, the Arch package for python-pillow copies the headers in src/libImaging to /usr/include/python3.6m. In particular, this means it installs raqm.h there (vendored by Pillow), even though /usr/include/raqm.h is also provided by the raqm package (also packaged in Arch as libraqm). When building my own Python C++ extension module that links to raqm but is totally unrelated to Pillow (https://github.com/anntzer/mplcairo), the standard approach of setuptools is to put /usr/include/python3.6m relatively early in the include search path. Thus, this means that it'll pick up the raqm.h shipped by python-pillow and patched by the Pillow team, rather than the upstream one shipped by libraqm. But that patched-by-Pillow version of raqm.h is actually unsuitable; in particular it contains lines such as #ifndef bool typedef int bool; #endif #ifndef uint32_t typedef UINT32 uint32_t; #endif which expands to typedefs which are invalid ("types" are not #ifdef'd so the typedefs are included, redefining "bool" to "int" is invalid in C++, and UINT32 is a Windows-only thing). Basically, the header shipped by python-pillow shadows the one shipped by libraqm but is invalid. While this may be considered an upstream issue ("they should fix their headers"), I don't think it is one because these headers were probably not intended for third-party use to start with, but only so that they can themselves build Pillow binaries. Even if you consider that these binaries should be packaged by Arch, I would suggest either - moving them to a subdirectory, e.g. /usr/include/python3.6m/pillow (similarly to how python-numpy does), or - at least don't include raqm.h there. Additional info: * python-pillow 5.0.0 Steps to reproduce: $ sudo pacman -S libraqm python-pillow $ sudo pacman -S python-{cairo,matplotlib} # mplcairo dependencies $ git clone https://github.com/anntzer/mplcairo $ cd mplcairo && MPLCAIRO_USE_LIBRAQM=1 python setup.py build |
This task depends upon
Closed by Antonio Rojas (arojas)
Monday, 04 April 2022, 09:24 GMT
Reason for closing: Fixed
Additional comments about closing: python-pillow 8.2.0
Monday, 04 April 2022, 09:24 GMT
Reason for closing: Fixed
Additional comments about closing: python-pillow 8.2.0
diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 5b01d84..62dc113 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -56,9 +56,6 @@ package_python-pillow() {
cd "$srcdir/$_appname-$pkgver"
python3 setup.py install --root="$pkgdir/" --optimize=1
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-
- install -dm755 "$pkgdir/usr/include/python$_py3basever/"
- install -m644 -t "$pkgdir/usr/include/python$_py3basever/" src/libImaging/*.h
}
package_python2-pillow() {
@@ -73,7 +70,4 @@ package_python2-pillow() {
cd "$srcdir/${_appname}-$pkgver"
python2 setup.py install --root="$pkgdir/" --optimize=1
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
-
- install -dm755 "$pkgdir/usr/include/python$_py2basever/"
- install -m644 -t "$pkgdir/usr/include/python$_py2basever/" src/libImaging/*.h
}
FS#37293for the example that caused it to be added.