Skip to content

Conversation

@lazka
Copy link
Contributor

@lazka lazka commented Oct 31, 2025

Like with Windows Python, we need to link to a different DLL which exports the limited API when using abi3.

This makes pyo3 link against libpython3.dll instead of libpython3.X.dll when abi3 is enabled.

Note: The limited API DLL is currently not provided in cygwin upstream, but only in MSYS2 (downstream):
msys2/MSYS2-packages#5751
I've contacted upstream about this change
https://cygwin.com/pipermail/cygwin-apps/2025-October/044659.html


With #5571 and this python-cryptography builds without changes to pyo3.

@lazka lazka marked this pull request as ready for review October 31, 2025 07:44
@lazka lazka force-pushed the cygwin-abi3 branch 2 times, most recently from ba5e387 to 768a7fb Compare October 31, 2025 11:25
@davidhewitt
Copy link
Member

Given that this will break cygwin builds until upstream ships libpython3.dll, should we enable this only with mingw / msys2 for now?

@lazka
Copy link
Contributor Author

lazka commented Nov 2, 2025

Given that this will break cygwin builds until upstream ships libpython3.dll, should we enable this only with mingw / msys2 for now?

Fair question, I think it's fine because:

  • Cygwin currently doesn't package rust or any python rust packages, but they plan to, so there are no regressions from this.
  • While building would work, it would produce a abi3 dll with a abi3 tag which links against a versioned DLL. Ideally cygwin would just do a one line change to the packages they build and disable abi3, which results in a proper non-abi3 wheel tag, DLL name etc.
  • Motivated by your question, I've asked upstream if it's OK here: https://cygwin.com/pipermail/cygwin-apps/2025-November/044673.html

Like with Windows Python, we need to link to a different
DLL which exports the limited API when using abi3.

This makes pyo3 link against libpython3.dll instead of
libpython3.X.dll when abi3 is enabled.

Note: The limited API DLL is currently not provided in
cygwin upstream, but only in MSYS2 (downstream):
msys2/MSYS2-packages#5751
I've contacted upstream about this change
https://cygwin.com/pipermail/cygwin-apps/2025-October/044659.html
@davidhewitt
Copy link
Member

Thanks, looking at your maillist thread, seems like we are ok to proceed to merge here?

@lazka
Copy link
Contributor Author

lazka commented Nov 5, 2025

(not sure if that question was directed at me, but I agree)

@davidhewitt davidhewitt added this pull request to the merge queue Nov 5, 2025
Merged via the queue into PyO3:main with commit 7ed0b2f Nov 5, 2025
43 checks passed
davidhewitt pushed a commit that referenced this pull request Nov 23, 2025
Like with Windows Python, we need to link to a different
DLL which exports the limited API when using abi3.

This makes pyo3 link against libpython3.dll instead of
libpython3.X.dll when abi3 is enabled.

Note: The limited API DLL is currently not provided in
cygwin upstream, but only in MSYS2 (downstream):
msys2/MSYS2-packages#5751
I've contacted upstream about this change
https://cygwin.com/pipermail/cygwin-apps/2025-October/044659.html
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.

2 participants