In a mingw shell it will call os.uname() which starts with MINGW..
resulting in bogus results. So just check for sys.platform which
is always "cygwin".
See #5143
pip has recently started to compare wheel tags with system supported wheel
tags, and as it turns out build tools just use sysconfig.get_platform() to generate
a tag (in setuptools, wheel, packaging, etc) for non-official platforms. For
official platforms they do various normalization steps and use other sources.
Since we can't really patch all those packages we need to provide a platform
string that wont change between updates.
* Don't include the cygwin version in it anymore, since that can change on updates.
* Hardcode to "cygwin" since builing for cygwin can change the output of os.uname()
The later breaks detection of MSYS2 compared to cygwin, but ideally no one should
depend on it, and we want to get rid of the differences there anyway.
Fixes#5143
* drop all distutils patches, distutils is gone
* drop all setup.py patches, that's gone too
* refresh the 32bit rebase (things changed, but I added
it to the same make target, hopefully still works)
* adjust the new module building code to depend on the import
lib and also add the build dir to the library path so it can
be found.
* ctypes dropped vendored things, so remove code deleting it
* the code printing a warning if a module build fails no longer
exists, so drop the "tee" stuff and the error check there
The main change here is that sys.platform == 'cygwin', which allows
us to drop various changes for extending cygwin checks. Fewer patches
and less likely that we miss to patch a new cygwin check on updates.
If one really needs to check for msys Python then this still works:
sysconfig.get_platform().startswith("msys")