-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building from source does not support freetype and raqm #7040
Comments
What version of CentOS are you using? I wouldn't have thought that you needed to run
So Pillow works without a problem in your normal environment? |
It is a multi-layer system, the centos layer is 7.9.
This is needed since the path of No, Pillow does not work properly. In summary, the setup after the build says everything is ok, but once installed in a virtual environment, support for Here's a fresh build that reproduce the issue: ~ $ module load python/3.10
~ $ git clone https://github.com/python-pillow/Pillow.git -b 9.4.0
~ $ makevenv
(8666) ~ $ pip install oldest-supported-numpy cython
(8666) ~ $ cd Pillow/
(8666) Pillow ((9.4.0) ) $ sed -i -e 's;/sbin/ldconfig;ldconfig;g' setup.py
(8666) Pillow ((9.4.0) *) $ export CPATH=$EBROOTGENTOO/include:$CPATH
(8666) Pillow ((9.4.0) *) $ export LIBRARY_PATH=$EBROOTGENTOO/lib64:$LIBRARY_PATH
(8666) Pillow ((9.4.0) *) $ python setup.py build_ext --inplace --debug --vendor-raqm bdist_wheel |& tee out.out
running build_ext
...
Using vendored version of raqm
...
--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version Pillow 9.4.0
platform linux 3.10.2 (main, Feb 4 2022, 19:10:35)
[GCC 9.3.0]
--------------------------------------------------------------------
--- JPEG support available
--- OPENJPEG (JPEG2000) support available (2.3)
--- ZLIB (PNG/ZIP) support available
*** LIBIMAGEQUANT support not available
--- LIBTIFF support available
--- FREETYPE2 support available
--- RAQM (Text shaping) support available (bundled)
--- LITTLECMS2 support available
--- WEBP support available
--- WEBPMUX support available
--- XCB (X protocol) support available
--------------------------------------------------------------------
--------------------------------------------------------------------
PIL SETUP SUMMARY
--------------------------------------------------------------------
version Pillow 9.4.0
platform linux 3.10.2 (main, Feb 4 2022, 19:10:35)
[GCC 9.3.0]
--------------------------------------------------------------------
--- JPEG support available
--- OPENJPEG (JPEG2000) support available
--- ZLIB (PNG/ZIP) support available
*** LIBIMAGEQUANT support not available
--- LIBTIFF support available
--- FREETYPE2 support available
--- RAQM (Text shaping) support available (bundled)
--- LITTLECMS2 support available
--- WEBP support available
--- WEBPMUX support available
--- XCB (X protocol) support available
--------------------------------------------------------------------
(8666) Pillow ((9.4.0) *) $ pip install dist/Pillow-9.4.0-cp310-cp310-linux_x86_64.whl --force-reinstall
(8666) Pillow ((9.4.0) *) $ cd
(8666) ~ $ python -c 'from PIL import features; print(features.check("raqm"))'
None
(8666) ~ $ python -c 'from PIL import features; print(features.check("freetype2"))'
False |
Importing the library
freetype version is: Ah, those versions are too old for Forcing the path to the |
The issue was the version of (8666) ~ $ python -c 'from PIL import features; print(features.check("freetype2"))'
True
(8666) ~ $ python -c 'from PIL import features; print(features.check("raqm"))'
True In light of this, and in order to help wheels builders/maintainers, I'd suggest to be more explicit when :
Also, I think the setup should verify that the version of dependencies are met. |
From what I can see, this is actually freetype 2.9.1 We should support it, according to https://pillow.readthedocs.io/en/stable/deprecations.html#freetype-2-7
However, libraqm raised the minimum version of FreeType required in HOST-Oman/libraqm#151. |
The main culprit was the version of |
PR #7044 has replaced "/sbin/ldconfig" with "ldconfig". This should be available in Pillow 9.5.0 in a few days. |
Great, thanks! |
It might be worth checking the version numbers of used libraries before starting a build, but I imagine you got an "implicit function declaration" warning (which really should be an error IMO) during the build. I'd suggest using
I could be misunderstanding here, but is (part of) the issue here that your system raqm was not correctly importing freetype and harfbuzz? |
Agreed, then the question : How can one normal user easily verify the version when they are not documented in the readme nor the installation docs? raises. But! A setup or any package should verify that its requirements are met. So many do with very complex setups, think of Sure, I could turn the warning into an error. Yes, both, the bundled and system raqm did not linked to a recent version of freetype and harfbuzz, causing the symbol not found. We updated the version of both freetype and hafbuzz and installed a system raqm to satisfy all requirements. If the exception raised would have been redirected to stderr or a warning issued, I would have found the culprit sooner. |
From a previous comment:
With the above, I'd also suggest:
|
AFAIK there are no explicit minimum versions (except for FreeType, as noted above), simply a requirement that the tested systems' default library versions are supported. IIRC, support for some library versions was unintentionally dropped in the past simply due to lack of testing. Looking at the latest CI run, the following are the minimum versions currently tested:
However, much older versions are likely supported, although it is unclear which ones due to lack of CI testing. |
I've created #7047 to avoid discarding the error message when importing |
I attempted to install a newer raqm on CentOS 7 to test it in combination with freetype 2.8.0 - but the installation failed because raqm detected that freetype2 wasn't recent enough. |
@nulano Right, I am mixing up requirements of a sub-dependency (raqm) and general requirements. Thanks both of you for the responsiveness and making improvements! |
@radarhere Works! Thanks! |
Building Pillow 9.4.0 from source does not seem to properly provide RAQM support.
Building with the bundled raqm (v0.9.0) or a system raqm (v0.9.0) fails to provide
freetype
orraqm
support.Using bundled raqm
Build commands
The build setup summary is ok:
But once installed in a virtual environment,
freetype
andraqm
are mentioned as not installed but the libraries are correctly linked:And running a short example results in the following error:
but the library exists.
Using system raqm
Building a system RAQM results in the same as above.
Build commands:
Setup from the build output:
But once installed in a virtual environment,
freetype
andraqm
are mentioned as not installed but the libraries are correctly linked:This looks like a bug to me but could a wrong detection from Pillow. Anyone successfully built Pillow with RAQM? What am I missing here?
The text was updated successfully, but these errors were encountered: