-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cygwin / MinGW32 build_ext broken (?) #109
Comments
Hi, I made this change. You can see the discussion in #41 I have some questions. Is there a I'm using MinGW-w64 which works with According to How do you monkeypatch |
Hi, answering the questions first:
To understand the relation between vcruntime140 and ucrt better, I introspected it with the Dependencies tool, which leaves me headscratching.
With my limited C skills, I'm lost in the desert here. I'll try upgrading MinGW; if that works, we can close this as invalid... |
I don't think python39.dll links ucrtbase. Try this command:
Thouse
No. It implicitly imports |
I know that a mingw-w64 toolchain that targets ucrt can't be used to build msvcrt stuff and vice versa. So I'm wondering if this function should just be removed maybe? This package only supports Python versions with ucrt anyway. |
I have no idea about removing this function. |
As I understand it, "ucrt" is a "concept" which finds its actual implementation in ucrtbase.dll... the You are right that my built extension imports system's Can you point me to your actual MinGW-w64 installer? The one I use had its latest release in 2018 (https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/installer/mingw-w64-install.exe/download) |
These are my collection. I'm actually using the second one. |
That's not supported by mingw-w64 at least. It might work if you are lucky, but you might also get linker errors or random crashes due to ABI mismatches. |
Thanks for the links! Can confirm that everything works again with the MinGW distribution from https://winlibs.com/. I'm fine with closing this issue. |
Anyway, I'm not an expert on C as well. @lazka feel free to open PR to remove the function whenever you think necessary. |
You can try using the UCRT toolchain from https://winlibs.com/ for example. This should allow you to drop all that monkey patching for spec files at least. |
Thinking more about this, the Only the error message could be made clearer ("please upgrade your C Compiler to support UCRT"), however I don't see how this could be implemented without hacks. So let's just close this as invalid. |
Thanks everyone for the investigation and civil discourse. |
Hey guys, after updating Setuptools to 60.something, my extension build broke.
I am using Python 3.9.4 and MinGW32 (64-bit).
My extension is a single-file C module, which doesn't use any particular libraries beyond the stdlib.
Build failed, because the linker tried to link
-lucrt
, which could not be found.I could trace this down to cygwincompiler.py:93, where on Nov 15 2021, support for MSVC version 1900...2000 was added / Commit eca30e8.
Previously my build was working, because I monkeypatched this function on my own. It broke by the upgrade, because my monkeypatch only became active if the "native"
get_msvcr()
failed.Now I am an amateur when it comes to C compilers. But it seems to me, that
get_msvcr
specifies that both ucrt (ucrtbase.dll) and vcruntime140 (vcruntime140.dll) shall be linked. This fails because Python (specifically my v3.9.4) only bundles vcruntime140.From what I've read,
ucrtbase
is supposed to replacevcruntime
. So I would only expect one of them has to be present? If this is correct, the compilation settings should not link both libraries, but rather pick one of them.Possible workarounds are
cygwincompiler.get_msvcr
to return["vcruntime140"]
only.The text was updated successfully, but these errors were encountered: