Skip to content

Conversation

@mhucka
Copy link
Collaborator

@mhucka mhucka commented Jul 1, 2025

The Python package Pillow is required by Matplotlib, which is a transitive dependency for qsim due to its requirement by cirq-core. Matplotlib does not pin the required version of Pillow (which is fine, and actually makes it possible to work around the current problem possible – see below). Unfortunately, as a result of changes introduced in Pillow version 11.3.0, our cibuildwheel runs are now failing for Linux because:

  1. In 11.3.0, Pillow switched to using cibuildwheel 3.0
  2. cibuildwheel 3.0 switched from manylinux2014 to manylinux_2_28 as the default
  3. which means Pillow 11.3.0 does not provide a wheel for manylinux2014
  4. which means when we run cibuildwheel for qsim for Linux, it needs to build Pillow from sources
  5. which fails because of missing dependencies in the manylinux2014 environment

Ours is not the only project suddenly facing this problem today (c.f. python-pillow/Pillow#9057).

In our case, the problem only manifests during the "Testing wheel …" phase on Linux. I tried many ways of passing pip constraints, but couldn't find a way to make the constraints take effect during the wheel-testing phase. Finally, the following approach worked: pip-install a version of Pillow < 11.3 using the before-test option of cibuildwheel, so that when cibuildwheel does its pip-install of the qsimcirq package that it built, the Pillow dependency is satisfied. This works because the requirement of Pillow in Matplotlib does not require 11.3; it just requires a version higher than 9, which our pre-installation of Pillow satisfies.

This should be a temporary workaround only. We should update qsim to use cibuildwheel 3 and manylinux_2_28 – this problem may go away at that point.

@github-actions github-actions bot added the Size: XS <10 lines changed label Jul 1, 2025
@mhucka mhucka marked this pull request as draft July 2, 2025 01:01
@github-actions github-actions bot added size: S 10< lines changed <50 and removed Size: XS <10 lines changed labels Jul 2, 2025
@mhucka mhucka changed the title Change to "pinned" for cibuildwheel dependencies Work around cibuildwheel failures due to Pillow version 11.3.0 released 2025-07-01 Jul 2, 2025
@mhucka mhucka changed the title Work around cibuildwheel failures due to Pillow version 11.3.0 released 2025-07-01 Work around cibuildwheel failures for Linux that are a byproduct of Pillow version 11.3.0 released on 2025-07-01 Jul 2, 2025
The work around works like this: we pip-install a version of Pillow <
11.3 using the `before-test` option of cibuildwheel, so that when
cibuildwheel does its pip-install of the qsimcirq package that it
built, the Pillow dependency is satisfied. This works because the
requirement of Pillow in Matplotlib does not require 11.3; it just
requires a version higher than 9, which our pre-installation of Pillow
satisfies.

This should be a temporary workaround only. We should update qsim to
use cibuildwheel 3 and manylinux_2_28 – this problem may go away at
that point.
@mhucka mhucka force-pushed the mh-use-pinned-cibuildwheel-deps branch from 715a783 to a452adf Compare July 2, 2025 03:25
@github-actions github-actions bot added Size: XS <10 lines changed and removed size: S 10< lines changed <50 labels Jul 2, 2025
@mhucka mhucka marked this pull request as ready for review July 2, 2025 23:20
@mhucka
Copy link
Collaborator Author

mhucka commented Jul 5, 2025

Closing because as of 2 days ago, the Pillow maintainers kindly reinstated manylinux2014 wheels on PyPI.

@mhucka mhucka closed this Jul 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Size: XS <10 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant