-
Notifications
You must be signed in to change notification settings - Fork 71
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: make get_msvcr() a noop + add a CI job testing MSVC Python with GCC #274
Conversation
…fault compiler The tests currently assume everywhere that there is only one compiler per platform, and while it would be possible to parametrize all the tests it would make things more complex and we'd also have to decide which compiler is required for running the tests and which one is optional etc. To avoid all this introduce a DISTUTILS_TEST_DEFAULT_COMPILER env var which can be used to override the default compiler type for the whole test run. This keeps the tests as is and makes sure all tests run against the alternative compiler. Also add it to pass_env for tox, so it gets passed to pytest, if set. The added CI job installs an ucrt targeting GCC via MSYS2, and forces the MSVC CPython to use it via DISTUTILS_TEST_DEFAULT_COMPILER=mingw32.
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
Its last use in cygwinccompiler was just removed.
(I initially made the test suite test against multiple compiler types, but that turned out to complicate things a lot, so I abandoned that approach: msys2-contrib@fa7e35b in case anyone is wondering how that would look like) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I have another commit I want to add to avoid re-implementing monkeypatching, but I can add that after the merge.
Amended as c9781ae. |
mingw: make get_msvcr() a noop + add a CI job testing MSVC Python with GCC
Thanks! And thanks for the improvements. |
See the commits for details.
Fixes #204