MQj d Z ddlZddlmZ ddlmZmZ ddlmZm Z m Z mZ ddlZddl Z ddlZddlZddlZddlZddlmZ ddlmZ dd lmZ ej d k rddlZddlmZ n G d d Z e Zd Zd ZdddddZd Z d Z!d Z"d Z#d#dZ$ G d d Z% G d d Z& G d d Z' G d! d" Z(dS )$a Improved support for Microsoft Visual C++ compilers. Known supported compilers: -------------------------- Microsoft Visual C++ 14.X: Microsoft Visual C++ Build Tools 2015 (x86, x64, arm) Microsoft Visual Studio Build Tools 2017 (x86, x64, arm, arm64) Microsoft Visual Studio Build Tools 2019 (x86, x64, arm, arm64) This may also support compilers shipped with compatible Visual Studio versions. N)open)listdirpathsep)joinisfileisdirdirname) LegacyVersion)unique_everseen ) get_unpatchedWindows)environc e Zd ZdZdZdZdZdS )winregN)__name__ __module____qualname__ HKEY_USERSHKEY_CURRENT_USERHKEY_LOCAL_MACHINEHKEY_CLASSES_ROOT /builddir/build/BUILDROOT/alt-python311-setuptools-65.6.3-2.el9.x86_64/opt/alt/python311/lib/python3.11/site-packages/setuptools/msvc.pyr r # s' ! r r c , t j t j ddt j t j z } n# t $ r Y dS w xY wd}d}| 5 t j D ]} t j | | \ }}}n# t $ r Y nkw xY w|rd|t j k rTt | rE t t | }n# t t f$ r Y w xY w|dk r ||k r||}}ddd n# 1 swxY w Y ||fS )0Python 3.8 "distutils/_msvccompiler.py" backportz'Software\Microsoft\VisualStudio\SxS\VC7r NNN )r OpenKeyr KEY_READKEY_WOW64_32KEYOSError itertoolscount EnumValueREG_SZr intfloat ValueError TypeError)keybest_versionbest_dirivvc_dirvtversions r _msvc14_find_vc2015r4 , s n%6 Of44 zz LH = ="" = =A & 0a 8 8 622 =R6=((U6]](!%((mmGG"I. Hb==W|%;%;-4f(L= = = = = = = = = = = = = = = !!si 8; A A D)BD B DB$D6CDC'$D&C''DDDc t j d pt j d } | sdS t j t | ddd ddd d dd dd dddg dd }n## t j t t f$ r Y dS w xY wt |ddd }t | rd|fS dS )a Python 3.8 "distutils/_msvccompiler.py" backport Returns "15, path" based on the result of invoking vswhere.exe If no install is found, returns "None, None" The version is returned to avoid unnecessarily changing the function result. It may be ignored when the path is not None. If vswhere.exe is not available, by definition, VS 2017 is not installed. ProgramFiles(x86)ProgramFilesr zMicrosoft Visual Studio Installerzvswhere.exez-latestz-prereleasez-requiresAnyz -requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z)Microsoft.VisualStudio.Workload.WDExpressz -propertyinstallationPathz -products*mbcsstrict)encodingerrorsVC AuxiliaryBuild )r get subprocesscheck_outputr decodestripCalledProcessErrorr# UnicodeDecodeErrorr )rootpaths r _msvc14_find_vc2017rL J s ;*++Jw{>/J/JD z&0+}MMLD+ ( 66(633EEGG )74FG zz dK11DT{{ 4x:s AB B&%B&x86x64armarm64)rM x86_amd64x86_arm x86_arm64c t \ }}d}| t v rt | }nd| v rdnd}|rYt |ddddd|d d } ddl}| |d d }n# t t t f$ r d}Y nw xY w|s&t \ }}|rt |d|dd }|sdS t |d }t | sdS |rt | sd}||fS )r Namd64rN rM z..redistMSVCz**zMicrosoft.VC14*.CRTzvcruntime140.dllr T) recursivezMicrosoft.VC140.CRTr z vcvarsall.bat) rL PLAT_SPEC_TO_RUNTIMEr globImportErrorr# LookupErrorr4 r ) plat_spec_r. vcruntimevcruntime_platvcredistr[ r- vcvarsalls r _msvc14_find_vcvarsallrd w s] %''KAxI(((-i8")Y"6"6E $h&(=*, , KKK (d ;;B?IIWk2 III H!4!6!6h HXx24FH HI zX//I) z F9-- is !A/ /B Bc J dt v rd t j D S t | \ }}|st j d t j d || t j dd }nO# t j $ r=}t j d |j |d }~ww xY wd d | D D }|r||d <