Skip to content

Support building with Mingw Python - #1423

Merged
davidhewitt merged 1 commit into
PyO3:masterfrom
lazka:mingw-support
Feb 12, 2021
Merged

Support building with Mingw Python#1423
davidhewitt merged 1 commit into
PyO3:masterfrom
lazka:mingw-support

Conversation

@lazka

@lazka lazka commented Feb 12, 2021

Copy link
Copy Markdown
Contributor

The DLL of the mingw Python in MSYS2 is named libpython3.8.dll:

$ python3 -m sysconfig | grep LIBPYTHON
LIBPYTHON = "-lpython3.8"

Add another special case to in get_rustc_link_lib() to handle that case.
Afaik the mingw build doesn't support the limited ABI, so skip that as well.

This makes all tests pass in an MSYS2 environment and lets us build
python-cryptography.

@lazka

lazka commented Feb 12, 2021

Copy link
Copy Markdown
Contributor Author

I know mingw Python isn't officially supported, but I thought this change is small enough to be considered anyway.

The DLL of the mingw Python in MSYS2 is named libpython3.8.dll:

$ python3 -m sysconfig | grep LIBPYTHON
        LIBPYTHON = "-lpython3.8"

Add another special case to in get_rustc_link_lib() to handle that case.
Afaik the mingw build doesn't support the limited ABI, so skipt that as well.

This makes all tests pass in an MSYS2 environment and lets us build
python-cryptography.
@davidhewitt

Copy link
Copy Markdown
Member

Thanks for the PR! I'm willing to merge this. Before we do, I wanted to ask whether we also need to consider adding a similar special case for PyPy?

@lazka

lazka commented Feb 12, 2021

Copy link
Copy Markdown
Contributor Author

Thanks. PyPy doesn't support mingw, so for that case nothing is needed. As for PyPy on Windows in general, I'd need to check.

@davidhewitt

Copy link
Copy Markdown
Member

Ah great. We already support PyPy on Windows so it sounds like there's no further changes needed here.

Would you mind rebasing on master? That should fix the CI issues.

(If you're willing to add a note to the ## Fixed section of the CHANGELOG documenting this at the same time, that'd be great.)

@davidhewitt

Copy link
Copy Markdown
Member

Actually nvm, I'll do this now as I'm preparing the next patch release atm. Sorry if you already started!

@davidhewitt
davidhewitt merged commit 3df4f9b into PyO3:master Feb 12, 2021
@lazka

lazka commented Feb 13, 2021

Copy link
Copy Markdown
Contributor Author

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.

2 participants