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

MSYS2 fixes #4890

Merged
merged 5 commits into from Sep 3, 2020
Merged

MSYS2 fixes #4890

merged 5 commits into from Sep 3, 2020

Conversation

nulano
Copy link
Contributor

@nulano nulano commented Aug 30, 2020

Changes proposed in this pull request:

  • Remove old include directory C:\\msys64\\mingw32\\include\\libimagequant.

    It uses a hardcoded path to MSYS2, it is hardcoded to 32-bit, and it is no longer necessary, as the include is now in C:\\msys64\\mingw32\\include\\libimagequant.h.

  • Remove GCC workaround for MSYS, see Replace distutils #4796 (comment)

    The issue was that AppVeyor was missing the MSYSTEM=MINGW32 envvar, and getting confused by the default MSYSTEM=MSYS2.

  • Fix LibTiff support. The issue is that MSYS2 builds LibTiff with USE_WIN32_FILEIO, which changes the meaning of the fd parameter for TIFFFdOpen, see OSError: -2 when decoding a tiff_lzw file #4237 (comment). I've added a workaround by converting the parameter before passing it to LibTiff if building on MinGW.

    It might be possible to detect the system version of LibTiff by including the tif_config.h header to fix OSError: -2 when decoding a tiff_lzw file #4237 (by enabling the workaround if USE_WIN32_FILEIO was enabled), but it appears to be a private header (while it is available in MSYS2, it is not available in Ubuntu). See also passing build using CMake on Windows from my branch nulano/Pillow@mingw-setup...nulano:tiff-test.

    Another possible fix would involve absorbing TIFFFdOpen from tif_unix.c into Pillow to avoid this issue by using the stable TiffClientOpen.

  • Document installation on MSYS2

1) it is hardcoded to 32-bit C:\msys64\mingw32
2) current library version uses \mingw64\include\libimagequant.h directly
@nulano nulano mentioned this pull request Aug 30, 2020
Comment on lines +324 to +332
mingw-w64-x86_64-libjpeg-turbo \
mingw-w64-x86_64-zlib \
mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-freetype \
mingw-w64-x86_64-lcms2 \
mingw-w64-x86_64-libwebp \
mingw-w64-x86_64-openjpeg2 \
mingw-w64-x86_64-libimagequant \
mingw-w64-x86_64-libraqm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
mingw-w64-x86_64-libjpeg-turbo \
mingw-w64-x86_64-zlib \
mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-freetype \
mingw-w64-x86_64-lcms2 \
mingw-w64-x86_64-libwebp \
mingw-w64-x86_64-openjpeg2 \
mingw-w64-x86_64-libimagequant \
mingw-w64-x86_64-libraqm
mingw-w64-x86_64-freetype \
mingw-w64-x86_64-lcms2 \
mingw-w64-x86_64-libimagequant \
mingw-w64-x86_64-libjpeg-turbo \
mingw-w64-x86_64-libraqm
mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-libwebp \
mingw-w64-x86_64-openjpeg2 \
mingw-w64-x86_64-zlib \

Sorted

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order is the same as in the External Libraries section above. I think it is more helpful to follow that order for easier cross-referencing if someone doesn't want a full install.

@lazka
Copy link

lazka commented Aug 31, 2020

@hugovk hugovk merged commit 63d8a60 into python-pillow:master Sep 3, 2020
@hugovk
Copy link
Member

hugovk commented Sep 3, 2020

Thanks!

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.

None yet

4 participants