distutils icon indicating copy to clipboard operation
distutils copied to clipboard

`CygwinCCompiler` is never used

Open naveen521kk opened this issue 3 years ago • 2 comments

While working on https://github.com/pypa/distutils/pull/184 I found that CygwinCCompiler is never used. If it was used it should be failing with TypeError as there's something wrong with get_msvcr (it shouldn't be returning None, https://github.com/pypa/distutils/pull/184/files#r1008651830).

It uses UnixCCompiler instead while compiling on that platform.

$ python -c 'import distutils.ccompiler as a; print(a.new_compiler())'
<distutils.unixccompiler.UnixCCompiler object at 0x6ffffff07c10>

I think the below line should be changed to cygwin instead of unix to use the correct compiler classes. Not sure why it was set to unix though. (and the blame is 22 years old, so no idea https://github.com/pypa/distutils/commit/e49a11577577efa7493fe079aec5b257a1796d00)

https://github.com/pypa/distutils/blob/6c39b5053c17ec41690dab9d11399e2f39389892/distutils/ccompiler.py#L1024

naveen521kk avatar Oct 29 '22 17:10 naveen521kk

You may be interested to know that https://github.com/pypa/distutils/pull/209#issuecomment-1554669584 suggested dropping CygwinCCompiler instead.

radarhere avatar May 26 '23 02:05 radarhere

What's the status of this issue now that #209 is merged?

jaraco avatar Jul 15 '24 16:07 jaraco