Skip to content
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

Update msc_ver detection #41

Merged
merged 6 commits into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions distutils/cygwinccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ def get_msvcr():
elif msc_ver == '1600':
# VS2010 / MSVC 10.0
return ['msvcr100']
elif msc_ver == '1700':
# VS2012 / MSVC 11.0
return ['msvcr110']
elif msc_ver == '1800':
# VS2013 / MSVC 12.0
return ['msvcr120']
elif 1900 <= int(msc_ver) < 2000:
# VS2015 / MSVC 14.0
return ['ucrt', 'vcruntime140']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can I confirm these are the right values to confirm? Have you tested distutils/setuptools with this patch? Does it fix the issue reported in the linked discussion?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @lazka

else:
raise ValueError("Unknown MS Compiler version %s " % msc_ver)

Expand Down
5 changes: 4 additions & 1 deletion distutils/tests/test_cygwinccompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,13 @@ def test_get_msvcr(self):
sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
'[MSC v.1500 32 bits (Intel)]')
self.assertEqual(get_msvcr(), ['msvcr90'])

sys.version = '3.10.0 (tags/v3.10.0:b494f59, Oct 4 2021, 18:46:30) [MSC v.1929 32 bit (Intel)]'
self.assertEqual(get_msvcr(), ['ucrt', 'vcruntime140'])

# unknown
sys.version = ('2.5.1 (r251:54863, Apr 18 2007, 08:51:08) '
'[MSC v.1999 32 bits (Intel)]')
'[MSC v.2000 32 bits (Intel)]')
self.assertRaises(ValueError, get_msvcr)

def test_suite():
Expand Down