-
-
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
Windows build improvements #6562
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…penjpeg binaries on windows
|
# Conflicts: # Tests/test_imagefont.py
19 tasks
hugovk
approved these changes
Oct 26, 2022
This was referenced Oct 29, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For #6369, close #6554, close #553
In an effort to sync the dependencies available on Linux/macOS (python-pillow/pillow-wheels) and Windows (test-windows.yml) ahead of the next release (#6460), I've compiled a list of dependencies (including indirect ones) below, and included some updates for Windows in this PR.
The full list is: (click to expand)
libjpeg
via its forklibjpeg-turbo
version 2.1.4 is included on all platformszlib
version 1.2.12, included on all platformslibtiff
version 4.4.0, included on all platformszlib
andlibjpeg
on all platformslzma2
version 5.2.6 fromxz
; added on Windows in this PR and added testwebp
because that is built afterlibtiff
on both platforms; swapped on Windows in this PR and added testdeflate
,jbig
,libjpeg12
,lerc
,zstd
, but cgohlke mentioned at least LERC being included in his wheels in _imaging Failed to Import in from PIL import Image #5573 (comment)webp
version 1.2.4, included on all platformslibjpeg
,libpng
,libtiff
, andgiflib
are only used for binary conversion utilities, notlibwebp
. However, on Linux/macOS multibuild ensures these are built beforewebp
. For Windows I movedwebp
to be built beforelibtiff
.freetype
version 2.12.1, included on all platformszlib
andlibpng
on all platformsharfbuzz
only on Windows because the cyclic dependency is tricky to resolve with GCCbzip2
version 1.0.8. I tried adding it on Windows, but the driverftbzip2
appears to have been left out of the Visual Studio project files. It is only used for.pcf.bz2
fonts which aren't that common anyway (especially on Windows).brotli
version 1.0.9 added in Added brotli pillow-wheels#320 for Linux/macOS and this PR for Windowslcms2
version 2.13.1libjpeg
,zlib
,libtiff
are only used in binary utilities, not the libraryopenjpeg
version 2.5.0zlib
,libpng
,libtiff
,lcms2
are only used in binary utilities, not the library; changed the build flag used on Windows to reflect this (makes builds marginally faster).harfbuzz
version 5.1.0 included on all platforms with its dependency FreeTypexcb
is included on Linux/macOS; not very useful on Windowsfribidi
is linked at runtime, support shim is enabled on all platformslibimagequant
is only used in tests, not included in wheelsChanges proposed in this pull request:
xz
, used bylibtiff
webp
beforelibtiff
rather than after so thatlibtiff
can use itbrotli
forfreetype
with a WOFF2 font test for Unknown file format error on somewoff2
fonts onImageFont.truetype()
#6554 / Added brotli pillow-wheels#320LICENSE
before building wheels (on GHA only)py_vcruntime_redist
variable. Although I previously thought it was no longer necessary, it turns out this is only true for recent builds of Python (such as the ones on GHA). It is still necessary for older builds such as the one on AppVeyor (I noticed it was emitting a linker warning). It can be safely removed again when Python 3.9.0 is the oldest supported release: https://github.com/python/cpython/blob/v3.9.0/Lib/distutils/_msvccompiler.py#L243This is enough to get the Windows and Linux/macOS mostly in sync, with
bzip2
forfreetype
, andxcb
not enabled on Windows, andwebp
forlibtiff
not enabled on Linux/macOS.Considerations for future PRs:
libtiff
dependencies (deflate
,lerc
,zstd
), might be worth adding on all platforms.Addbrotli
for Unknown file format error on somewoff2
fonts onImageFont.truetype()
#6554_webp
and_imaging
could save about 0.5MB per wheel with thelibtiff
changes above.Additional testing (e.g. _imaging Failed to Import in from PIL import Image #5573 (comment)); I'm working on a separate PR.see Check available features in Windows wheels #6847; edit: see also bpo-25361: enables use of SSE2 instructions in Windows 32-bit build. python/cpython#12438; edit2: fixed in libpng v1.6.41libpng
is failing to detect SSE2 support, should be safe to patch in (even Windows 7 requires SSE2 now)harfbuzz
build warning:openjpeg
suggests enabling SSE4.1/AVX2 if available, probably not safe to enable yet