-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
MinGW without vcruntime140 and without distutils #4101
Comments
My personal opinion would be that the best course of action here would be contacting the
Please note that |
I wasn't at all aware of that out-of-stdlib distutils project. You're right, I'll ask over there regarding vcruntime. It looks like there's already some talk regarding MinGW compiling going on. Closing for now, we'll see once that distutils part is fixed how far we can standardize the setuptools side in our use-case, and if needed open a new issue on that specific topic. Thanks a lot! |
This was added back in the day to make mingw use the same CRT as CPython (https://bugs.python.org/issue870382), but at least with newer mingw-w64 and ucrt switching the CRT at "runtime" isn't supported anymore. To build a compatible extension you have to use a ucrt mingw-w64 build, so things match up and link against the same CRT. CPython 3.5+ uses ucrt (see https://wiki.python.org/moin/WindowsCompilers), so anything besides that is no longer relevant, which only leaves vcruntime140. Since it's not clear what linking against vcruntime140 solves, and there have been reports of it needing to be patched out: * pypa/setuptools#4101 * pypa#204 (comment) let's just make it return nothing. Keep get_msvcr() around for now to avoid breaking code which patched it. Fixes pypa#204
This was added back in the day to make mingw use the same CRT as CPython (https://bugs.python.org/issue870382), but at least with newer mingw-w64 and ucrt switching the CRT at "runtime" isn't supported anymore. To build a compatible extension you have to use a ucrt mingw-w64 build, so things match up and link against the same CRT. CPython 3.5+ uses ucrt (see https://wiki.python.org/moin/WindowsCompilers), so anything besides that is no longer relevant, which only leaves vcruntime140. Since it's not clear what linking against vcruntime140 solves, and there have been reports of it needing to be patched out: * pypa/setuptools#4101 * #204 (comment) let's just make it return nothing. Keep get_msvcr() around for now to avoid breaking code which patched it. Fixes #204
Hi,
I maintain https://github.com/PetterS/quickjs. We target Linux, macOS and Windows. On Windows, we rely on the MinGW tooling (
python setup.py build -c mingw32
).For years we have monkey-patched distutils for this to work (https://github.com/PetterS/quickjs/blob/master/setup.py#L18). If we don't, we get
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lvcruntime140
.We don't see why we would need to link with the vcruntime when building with MinGW in general, and in particular we have no use for it in quickjs.
And distutils is deprecated with removal planned for Python 3.12.
So: what is the official way to handle this situation, without vcruntime (unless you can point an actual reason for us to link it in), without using deprecated modules and without monkey-patching setuptools' internals?
Thanks in advance.
EDIT: bonus points if this official way allows us to drop setup.py completely in favor of the modern, declarative way. (setup.cfg? pyproject.toml? build.py?)
The text was updated successfully, but these errors were encountered: