Skip to content

Fix Verify Builds broken by Cython 3.3.0 pyzmq incompatibility - #324

Merged
dwoz merged 2 commits into
mainfrom
fix-pyzmq-cython-3.3-compat
Aug 24, 2026
Merged

dwoz merged 2 commits into
mainfrom
fix-pyzmq-cython-3.3-compat

Conversation

@dwoz

@dwoz dwoz commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Cython 3.3.0 (released 2026-08-22) tightened pure-Python-mode name-conflict detection and rejects pyzmq's hint: pointer(_zhint) = cast(...) in zmq/backend/cython/_zmq.py with 'hint' redeclared. Every source install of pyzmq <=26.4.0 has been failing since; that's affecting main and blocking the Release 0.22.23 auto-update PR (#322).

Three tests now go red on every native platform where pyzmq 26.4.0 gets built from source:

  • test_pip_install_pyzmq[26.4.0]
  • test_pip_install_salt_w_static_requirements[3006.x] (Salt 3006.x pins pyzmq 26.4.0)
  • test_pip_install_salt_w_package_requirements[3006.x] (same)

Fix

  • Add 27.2.0 to the test_pip_install_pyzmq parametrize — pyzmq 27.x is Cython-3.3-clean upstream; this test proves the current combination works.
  • Set PIP_CONSTRAINT=cython<3.3 on the older pyzmq parametrize cells (23.2.0, 25.1.2, 26.2.0, 26.4.0). pip 22+ propagates this into PEP 517 build-isolation subprocesses, so the pyzmq build env resolves Cython 3.2.9 and compiles.
  • Same constraint on both salt 3006.x tests since Salt's own requirements pin pyzmq 26.4.0 and we can't change them.
  • Xfail pyzmq 27.2.0 on Windows: --no-binary=:all: forces the isolated build env to build Cython 3.3.0 from source, and MSVC hits fatal error C1083: Cannot open compiler generated file: '': Invalid argument when pip's isolated tempdir path exceeds Windows' effective path limit. Not a pyzmq/Cython issue per se — a Windows build-isolation path-length quirk.

Test plan

  • Verify Linux (3.10, aarch64) — was failing all three tests; should now pass all three.
  • Verify Linux (3.10, x86_64) — same.
  • Verify MacOS (M1) (3.10, arm64) — was failing pyzmq[26.4.0]; should pass.
  • Verify MacOS (3.10, x86_64) — same.
  • Verify Windows (3.10, amd64) — new pyzmq[27.2.0] xfails cleanly.
  • Once green here and merged, re-run auto-update-versions for Release 0.22.23 #322 so the fix propagates into that branch's next cut.

dwoz added 2 commits August 24, 2026 13:20
Cython 3.3.0 (released 2026-08-22) tightened pure-Python-mode name-conflict
detection and rejects pyzmq's `hint: pointer(_zhint) = cast(...)` in
zmq/backend/cython/_zmq.py with "'hint' redeclared". This breaks
pip-installing pyzmq <=26.4.0 from source, since pyzmq's isolated build env
resolves cython>=3.0.0 to the newest available. Fixed upstream in pyzmq 27.x.

- Add pyzmq 27.2.0 to test_pip_install_pyzmq to cover the current
  latest-pyzmq + latest-Cython combination.
- Set PIP_CONSTRAINT=cython<3.3 on the older pyzmq parametrize cells
  (23.2.0, 25.1.2, 26.2.0, 26.4.0) so their isolated build env picks
  Cython 3.2.9 and still compiles. Set AFTER the `env = os.environ.copy()`
  reset later in the function so it survives to the pyzmq install subprocess.
- Same constraint on test_pip_install_salt_w_static_requirements and
  test_pip_install_salt_w_package_requirements: Salt 3006.x's requirements
  pin pyzmq 26.4.0, which we can't change, so the transitive build otherwise
  fails.
- Xfail pyzmq 27.2.0 on Windows: --no-binary=:all: forces the isolated build
  env to build Cython 3.3.0 from source too, and MSVC hits
  "fatal error C1083: Cannot open compiler generated file: '': Invalid argument"
  when pip's isolated tempdir path exceeds Windows' effective path limit.
PIP_CONSTRAINT (--constraint) only affects the outer install; pip does not
propagate it into PEP 517 build-isolation subprocesses. That's why the
previous fix appeared to be applied (env dump showed PIP_CONSTRAINT set)
but pyzmq's isolated build env still resolved Cython 3.3.0 and hit
'hint redeclared'.

The right knob is PIP_BUILD_CONSTRAINT (pip 24.2+, maps to --build-constraint),
which is what constrains build-isolation deps like Cython. Set both env vars
for safety, since the outer install pins pyzmq==exact-version anyway.
@dwoz
dwoz merged commit b71c47a into main Aug 24, 2026
79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant