From 05f9e20c53fc00964508b26a8c1dd98776b9b261 Mon Sep 17 00:00:00 2001 From: nulano Date: Fri, 13 Jan 2023 03:31:17 +0100 Subject: [PATCH 01/11] GHA: test msys2 clang and ucrt systems --- .../{test-mingw.yml => test-msys2.yml} | 53 ++++++++++++------- 1 file changed, 34 insertions(+), 19 deletions(-) rename .github/workflows/{test-mingw.yml => test-msys2.yml} (52%) diff --git a/.github/workflows/test-mingw.yml b/.github/workflows/test-msys2.yml similarity index 52% rename from .github/workflows/test-mingw.yml rename to .github/workflows/test-msys2.yml index 36bb38cd7..1ac0d5adb 100644 --- a/.github/workflows/test-mingw.yml +++ b/.github/workflows/test-msys2.yml @@ -1,4 +1,4 @@ -name: Test MinGW +name: Test MSYS2 on: push: @@ -21,16 +21,26 @@ concurrency: jobs: build: runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - msystem: "UCRT64" + package: "mingw-w64-ucrt-x86_64" + - msystem: "CLANG64" + package: "mingw-w64-clang-i686" + - msystem: "MINGW64" + package: "mingw-w64-x86_64" defaults: run: shell: bash.exe --login -eo pipefail "{0}" env: - MSYSTEM: MINGW64 + MSYSTEM: ${{ matrix.msystem }} CHERE_INVOKING: 1 timeout-minutes: 30 - name: "MinGW" + name: MSYS2 ${{ matrix.msystem }} steps: - name: Checkout Pillow @@ -43,22 +53,27 @@ jobs: - name: Install dependencies run: | pacman -S --noconfirm \ - mingw-w64-x86_64-freetype \ - mingw-w64-x86_64-gcc \ - mingw-w64-x86_64-ghostscript \ - 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-python3-cffi \ - mingw-w64-x86_64-python3-numpy \ - mingw-w64-x86_64-python3-olefile \ - mingw-w64-x86_64-python3-pip \ - mingw-w64-x86_64-python3-setuptools \ - mingw-w64-x86_64-python-pyqt6 + ${{ matrix.package }}-freetype \ + ${{ matrix.package }}-gcc \ + ${{ matrix.package }}-ghostscript \ + ${{ matrix.package }}-lcms2 \ + ${{ matrix.package }}-libimagequant \ + ${{ matrix.package }}-libjpeg-turbo \ + ${{ matrix.package }}-libraqm \ + ${{ matrix.package }}-libtiff \ + ${{ matrix.package }}-libwebp \ + ${{ matrix.package }}-openjpeg2 \ + ${{ matrix.package }}-python3-cffi \ + ${{ matrix.package }}-python3-numpy \ + ${{ matrix.package }}-python3-olefile \ + ${{ matrix.package }}-python3-pip \ + ${{ matrix.package }}-python3-setuptools \ + subversion + + if [[ ${{ matrix.package }} =~ "x86_64" ]]; then + pacman -S --noconfirm \ + ${{ matrix.package }}-python-pyqt6 + fi python3 -m pip install pyroma pytest pytest-cov pytest-timeout From 0546eb9b8eb53e6ba095cd5bdc5f4c332c09db2f Mon Sep 17 00:00:00 2001 From: nulano Date: Fri, 13 Jan 2023 04:39:13 +0100 Subject: [PATCH 02/11] msys2: update install documentation --- docs/installation.rst | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index e29709bff..664fb6833 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -285,8 +285,23 @@ Many of Pillow's features require external libraries: .. tab:: Windows using MSYS2/MinGW - To build Pillow using MSYS2, make sure you run the **MSYS2 MinGW 64-bit** console, - *not* **MSYS2** directly. + The following instructions are for the **MSYS2 MINGW64** system. + To build Pillow on one of the other MSYS2 systems, replace all occurences of + ``mingw-w64-x86_64`` with the corresponding prefix: + + .. list-table:: + :header-rows: 1 + + * - MSYS2 system + - Package prefix + * - **UCRT64** + - ``mingw-w64-ucrt-x86_64`` + * - **CLANG64** + - ``mingw-w64-clang-x86_64`` + * - **MINGW64** + - ``mingw-w64-x86_64`` + + Installing in **MSYS2 MSYS** is not supported. Make sure you have Python and GCC installed:: @@ -296,7 +311,7 @@ Many of Pillow's features require external libraries: mingw-w64-x86_64-python3-pip \ mingw-w64-x86_64-python3-setuptools - Prerequisites are installed on **MSYS2 MinGW 64-bit** with:: + Prerequisites are installed on **MSYS2 MINGW64** with:: pacman -S \ mingw-w64-x86_64-libjpeg-turbo \ @@ -472,7 +487,7 @@ These platforms are built and tested for every change. | Windows Server 2022 | 3.8, 3.9, 3.10, 3.11, | x86-64 | | | 3.12, PyPy3 | | | +----------------------------+---------------------+ -| | 3.9 (MinGW) | x86-64 | +| | 3.9 (MSYS2) | x86-64 | | +----------------------------+---------------------+ | | 3.8, 3.9 (Cygwin) | x86-64 | +----------------------------------+----------------------------+---------------------+ From d367a313b3b46af1705d4b2e65239e10990b4466 Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 2 Feb 2023 17:11:56 +0000 Subject: [PATCH 03/11] update installation instructions for MSYS2 UCRT64 --- docs/installation.rst | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/installation.rst b/docs/installation.rst index 664fb6833..9554da27d 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -285,9 +285,9 @@ Many of Pillow's features require external libraries: .. tab:: Windows using MSYS2/MinGW - The following instructions are for the **MSYS2 MINGW64** system. + The following instructions are for the **MSYS2 UCRT64** system. To build Pillow on one of the other MSYS2 systems, replace all occurences of - ``mingw-w64-x86_64`` with the corresponding prefix: + ``mingw-w64-ucrt-x86_64`` with the corresponding prefix: .. list-table:: :header-rows: 1 @@ -306,23 +306,23 @@ Many of Pillow's features require external libraries: Make sure you have Python and GCC installed:: pacman -S \ - mingw-w64-x86_64-gcc \ - mingw-w64-x86_64-python3 \ - mingw-w64-x86_64-python3-pip \ - mingw-w64-x86_64-python3-setuptools + mingw-w64-ucrt-x86_64-gcc \ + mingw-w64-ucrt-x86_64-python3 \ + mingw-w64-ucrt-x86_64-python3-pip \ + mingw-w64-ucrt-x86_64-python3-setuptools - Prerequisites are installed on **MSYS2 MINGW64** with:: + Prerequisites are installed on **MSYS2 UCRT64** with:: pacman -S \ - 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-ucrt-x86_64-libjpeg-turbo \ + mingw-w64-ucrt-x86_64-zlib \ + mingw-w64-ucrt-x86_64-libtiff \ + mingw-w64-ucrt-x86_64-freetype \ + mingw-w64-ucrt-x86_64-lcms2 \ + mingw-w64-ucrt-x86_64-libwebp \ + mingw-w64-ucrt-x86_64-openjpeg2 \ + mingw-w64-ucrt-x86_64-libimagequant \ + mingw-w64-ucrt-x86_64-libraqm https://www.msys2.org/docs/python/ states that setuptools >= 60 does not work with MSYS2. To workaround this, before installing Pillow you must run:: From eba06792caab30112563740c8e0c80ba27c3bcd1 Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 2 Feb 2023 17:13:25 +0000 Subject: [PATCH 04/11] replace msys2 package check with msystem check --- .github/workflows/test-msys2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-msys2.yml b/.github/workflows/test-msys2.yml index 1ac0d5adb..f2c7fe652 100644 --- a/.github/workflows/test-msys2.yml +++ b/.github/workflows/test-msys2.yml @@ -70,7 +70,7 @@ jobs: ${{ matrix.package }}-python3-setuptools \ subversion - if [[ ${{ matrix.package }} =~ "x86_64" ]]; then + if [[ ${{ matrix.msystem }} =~ "64" ]]; then pacman -S --noconfirm \ ${{ matrix.package }}-python-pyqt6 fi From fa0995071f13fe9564e517b54b41b8eda66dd9d2 Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 2 Feb 2023 17:28:14 +0000 Subject: [PATCH 05/11] GHA: use pacboy to install msys2 packages --- .github/workflows/test-msys2.yml | 44 +++++++++++++------------------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test-msys2.yml b/.github/workflows/test-msys2.yml index f2c7fe652..9aa940faf 100644 --- a/.github/workflows/test-msys2.yml +++ b/.github/workflows/test-msys2.yml @@ -26,12 +26,8 @@ jobs: matrix: include: - msystem: "UCRT64" - package: "mingw-w64-ucrt-x86_64" - msystem: "CLANG64" - package: "mingw-w64-clang-i686" - msystem: "MINGW64" - package: "mingw-w64-x86_64" - defaults: run: shell: bash.exe --login -eo pipefail "{0}" @@ -52,28 +48,24 @@ jobs: - name: Install dependencies run: | - pacman -S --noconfirm \ - ${{ matrix.package }}-freetype \ - ${{ matrix.package }}-gcc \ - ${{ matrix.package }}-ghostscript \ - ${{ matrix.package }}-lcms2 \ - ${{ matrix.package }}-libimagequant \ - ${{ matrix.package }}-libjpeg-turbo \ - ${{ matrix.package }}-libraqm \ - ${{ matrix.package }}-libtiff \ - ${{ matrix.package }}-libwebp \ - ${{ matrix.package }}-openjpeg2 \ - ${{ matrix.package }}-python3-cffi \ - ${{ matrix.package }}-python3-numpy \ - ${{ matrix.package }}-python3-olefile \ - ${{ matrix.package }}-python3-pip \ - ${{ matrix.package }}-python3-setuptools \ - subversion - - if [[ ${{ matrix.msystem }} =~ "64" ]]; then - pacman -S --noconfirm \ - ${{ matrix.package }}-python-pyqt6 - fi + pacboy -S --noconfirm \ + freetype:p \ + gcc:p \ + ghostscript:p \ + lcms2:p \ + libimagequant:p \ + libjpeg-turbo:p \ + libraqm:p \ + libtiff:p \ + libwebp:p \ + openjpeg2:p \ + python3-cffi:p \ + python3-numpy:p \ + python3-olefile:p \ + python3-pip:p \ + python3-setuptools:p \ + python-pyqt6:p \ + subversion: python3 -m pip install pyroma pytest pytest-cov pytest-timeout From f69347edd271e88d8eff57e55cb9dcf1fc2a0994 Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 2 Feb 2023 17:30:30 +0000 Subject: [PATCH 06/11] GHA: skip some msys2 jobs --- .github/workflows/test-msys2.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-msys2.yml b/.github/workflows/test-msys2.yml index 9aa940faf..cb206171a 100644 --- a/.github/workflows/test-msys2.yml +++ b/.github/workflows/test-msys2.yml @@ -25,7 +25,9 @@ jobs: fail-fast: false matrix: include: - - msystem: "UCRT64" + # skip to save CI time: + # see https://github.com/python-pillow/Pillow/pull/6888#issuecomment-1400392821 + # - msystem: "UCRT64" - msystem: "CLANG64" - msystem: "MINGW64" defaults: From 2e469bd6397a3b8dbf4f514f62637f9cd940946f Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 2 Feb 2023 17:32:58 +0000 Subject: [PATCH 07/11] update CI targets table --- docs/installation.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/installation.rst b/docs/installation.rst index 9554da27d..6e47d3cfb 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -487,7 +487,7 @@ These platforms are built and tested for every change. | Windows Server 2022 | 3.8, 3.9, 3.10, 3.11, | x86-64 | | | 3.12, PyPy3 | | | +----------------------------+---------------------+ -| | 3.9 (MSYS2) | x86-64 | +| | 3.9 (CLANG64, MINGW64) | x86-64 | | +----------------------------+---------------------+ | | 3.8, 3.9 (Cygwin) | x86-64 | +----------------------------------+----------------------------+---------------------+ From 286db61d2e8ef744dbff26c26699176f2929d919 Mon Sep 17 00:00:00 2001 From: nulano Date: Thu, 2 Feb 2023 17:36:19 +0000 Subject: [PATCH 08/11] make sure pacboy is installed --- .github/workflows/test-msys2.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-msys2.yml b/.github/workflows/test-msys2.yml index cb206171a..afcf02487 100644 --- a/.github/workflows/test-msys2.yml +++ b/.github/workflows/test-msys2.yml @@ -50,6 +50,10 @@ jobs: - name: Install dependencies run: | + pacman -S --noconfirm \ + pactoys \ + subversion + pacboy -S --noconfirm \ freetype:p \ gcc:p \ @@ -66,8 +70,7 @@ jobs: python3-olefile:p \ python3-pip:p \ python3-setuptools:p \ - python-pyqt6:p \ - subversion: + python-pyqt6:p python3 -m pip install pyroma pytest pytest-cov pytest-timeout From b85385407ab1f4ffe4d92559159a25a5906b4e13 Mon Sep 17 00:00:00 2001 From: nulano Date: Sun, 12 Feb 2023 00:18:03 +0000 Subject: [PATCH 09/11] simplify MSYS2 testing on GHA --- .github/workflows/test-msys2.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-msys2.yml b/.github/workflows/test-msys2.yml index afcf02487..64387f665 100644 --- a/.github/workflows/test-msys2.yml +++ b/.github/workflows/test-msys2.yml @@ -51,6 +51,7 @@ jobs: - name: Install dependencies run: | pacman -S --noconfirm \ + make \ pactoys \ subversion @@ -77,17 +78,17 @@ jobs: pushd depends && ./install_extra_test_images.sh && popd - name: Build Pillow - run: SETUPTOOLS_USE_DISTUTILS="stdlib" CFLAGS="-coverage" python3 -m pip install . + run: SETUPTOOLS_USE_DISTUTILS="stdlib" .ci/build.sh - name: Test Pillow - run: | - python3 selftest.py --installed - python3 -c "from PIL import Image" - python3 -m pytest -vx --cov PIL --cov Tests --cov-report term --cov-report xml Tests + run: .ci/test.sh + + - name: After success + run: .ci/after_success.sh - name: Upload coverage uses: codecov/codecov-action@v3 with: file: ./coverage.xml flags: GHA_Windows - name: "MSYS2 MinGW" + name: MSYS2 ${{ matrix.msystem }} From 469f9e3c2c9cfc7991b85b6a2ef68e8eac22a9f2 Mon Sep 17 00:00:00 2001 From: nulano Date: Sun, 25 Jun 2023 10:05:01 +0100 Subject: [PATCH 10/11] Updated mergify.yml --- .github/mergify.yml | 2 +- .github/workflows/test-msys2.yml | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/mergify.yml b/.github/mergify.yml index 3c2066137..c27a84d0d 100644 --- a/.github/mergify.yml +++ b/.github/mergify.yml @@ -7,7 +7,7 @@ pull_request_rules: - status-success=Test Successful - status-success=Docker Test Successful - status-success=Windows Test Successful - - status-success=MinGW + - status-success=MSYS2 Test Successful - status-success=Cygwin Test Successful - status-success=continuous-integration/appveyor/pr actions: diff --git a/.github/workflows/test-msys2.yml b/.github/workflows/test-msys2.yml index 64387f665..f822f36c6 100644 --- a/.github/workflows/test-msys2.yml +++ b/.github/workflows/test-msys2.yml @@ -92,3 +92,13 @@ jobs: file: ./coverage.xml flags: GHA_Windows name: MSYS2 ${{ matrix.msystem }} + + success: + permissions: + contents: none + needs: build + runs-on: ubuntu-latest + name: MSYS2 Test Successful + steps: + - name: Success + run: echo MSYS2 Test Successful From bf2ee413f2e03f54df5df0af5c0db78bbfc8bb57 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 15 Jan 2025 21:39:55 +1100 Subject: [PATCH 11/11] Use python instead of python3 packages --- .github/workflows/test-msys2.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-msys2.yml b/.github/workflows/test-msys2.yml index f4678e5f6..87e945576 100644 --- a/.github/workflows/test-msys2.yml +++ b/.github/workflows/test-msys2.yml @@ -79,9 +79,9 @@ jobs: libtiff:p \ libwebp:p \ openjpeg2:p \ - python3-numpy:p \ - python3-olefile:p \ - python3-pip:p \ + python-numpy:p \ + python-olefile:p \ + python-pip:p \ python-pyqt6:p python3 -m pip install pyroma pytest pytest-cov pytest-timeout