Skip to content
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 17 commits into from Oct 27, 2022
Merged

Windows build improvements #6562

merged 17 commits into from Oct 27, 2022

Conversation

nulano
Copy link
Contributor

@nulano nulano commented Sep 7, 2022

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 fork libjpeg-turbo version 2.1.4 is included on all platforms
  • zlib version 1.2.12, included on all platforms
  • libtiff version 4.4.0, included on all platforms
    • uses zlib and libjpeg on all platforms
    • Linux/macOS uses lzma2 version 5.2.6 from xz; added on Windows in this PR and added test
    • no platform uses webp because that is built after libtiff on both platforms; swapped on Windows in this PR and added test
    • no current wheels include deflate, 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 platforms
    • AFAICT its dependencies libjpeg, libpng, libtiff, and giflib are only used for binary conversion utilities, not libwebp. However, on Linux/macOS multibuild ensures these are built before webp. For Windows I moved webp to be built before libtiff.
  • freetype version 2.12.1, included on all platforms
    • uses zlib and libpng on all platforms
    • uses harfbuzz only on Windows because the cyclic dependency is tricky to resolve with GCC
    • only Linux/macOS uses bzip2 version 1.0.8. I tried adding it on Windows, but the driver ftbzip2 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 Windows
  • lcms2 version 2.13.1
    • AFAICT its dependencies libjpeg, zlib, libtiff are only used in binary utilities, not the library
  • openjpeg version 2.5.0
    • according to the readme and build files its dependencies zlib, 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 FreeType
  • xcb is included on Linux/macOS; not very useful on Windows
  • fribidi is linked at runtime, support shim is enabled on all platforms
  • libimagequant is only used in tests, not included in wheels

Changes proposed in this pull request:

This is enough to get the Windows and Linux/macOS mostly in sync, with bzip2 for freetype, and xcb not enabled on Windows, and webp for libtiff not enabled on Linux/macOS.

Considerations for future PRs:

@cgohlke
Copy link
Contributor

cgohlke commented Sep 10, 2022

no current wheels include deflate, jbig, libjpeg12, lerc, zstd

cgohlke's wheels included more libtiff dependencies

libtiff included in the Windows wheels was built with libjpeg-turbo, libwebp, libdeflate, zstd, lerc, and lzma. JBIG-KIT is GPL licensed.

hugovk
hugovk approved these changes Oct 26, 2022
@hugovk hugovk added this to the 9.3.0 milestone Oct 26, 2022
@hugovk hugovk merged commit d0ad0a0 into python-pillow:main Oct 27, 2022
58 of 60 checks passed
@nulano nulano deleted the winbuild-update branch October 27, 2022 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unknown file format error on some woff2 fonts on ImageFont.truetype() Current Windows Build/Testing process
4 participants