Skip to content

Add Cygwin support#2819

Merged
messense merged 1 commit intoPyO3:mainfrom
lazka:cygwin
Nov 3, 2025
Merged

Add Cygwin support#2819
messense merged 1 commit intoPyO3:mainfrom
lazka:cygwin

Conversation

@lazka
Copy link
Copy Markdown
Contributor

@lazka lazka commented Nov 2, 2025

Add Cygwin to all OS logic and bump target-lexicon dependency to 0.13.3 for Cygwin support.

In fun_with_abiflags() add a special case for cygwin, since platform.system() returns something like "CYGWIN_NT-10.0-26200" there, and not just "Cygwin" alone like with other systems.

In get_platform_tag() default to something like "cygwin-x86_64", which doesn't match sysconfig.get_platform() in upstream Cygwin currently, but is proposed here to make pip happy:
https://cygwin.com/pipermail/cygwin-apps/2025-October/044659.html

In write_bindings_module() use ".abi3.dll" for abi3 builds, as importlib.machinery.EXTENSION_SUFFIXES looks like
['.cpython-39-x86_64-cygwin.dll', '.abi3.dll', '.dll'] on Cygwin.

With this, one gets a working maturin when building with --no-default-features --features cli-completion,scaffolding. The other features pull in abandoned crates that don't work on Cygwin, like #1858

Fixes #2818

Co-authored-by: @Kreijstal

Add Cygwin to all OS logic and bump `target-lexicon` dependency to 0.13.3 for
Cygwin support.

In `fun_with_abiflags()` add a special case for cygwin, since
`platform.system()` returns something like `"CYGWIN_NT-10.0-26200"` there, and
not just `"Cygwin"` alone like with other systems.

In `get_platform_tag()` default to something like `"cygwin-x86_64"`, which
doesn't match `sysconfig.get_platform()` in upstream Cygwin currently, but is
proposed here to make pip happy:
https://cygwin.com/pipermail/cygwin-apps/2025-October/044659.html

In `write_bindings_module()` use `".abi3.dll"` for abi3 builds, as
`importlib.machinery.EXTENSION_SUFFIXES` looks like
`['.cpython-39-x86_64-cygwin.dll', '.abi3.dll', '.dll']` on Cygwin.

With this, one gets a working maturin when building with `--no-default-features
--features cli-completion,scaffolding`. The other features pull in abandoned
crates that don't work on Cygwin, like
PyO3#1858

Fixes PyO3#2818
Copy link
Copy Markdown
Member

@messense messense left a comment

Choose a reason for hiding this comment

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

Thanks!

@messense messense merged commit 608963e into PyO3:main Nov 3, 2025
43 checks passed
@lazka
Copy link
Copy Markdown
Contributor Author

lazka commented Nov 3, 2025

Thanks!

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.

Cygwin Support

2 participants