efL6dZddlZddlZddlZddlZddlmZeje5ddl Z dddn #1swxYwYddl m Z m Z m Z mZmZddlmZmZddlmZddlmZddlmZd Zd Zd d d ddZdZdZddZd ddddZGddeZ dS)adistutils._msvccompiler Contains MSVCCompiler, an implementation of the abstract CCompiler class for Microsoft Visual Studio 2015. The module is compatible with VS 2015 and later. You can find legacy support for older versions in distutils.msvc9compiler and distutils.msvccompiler. N)DistutilsExecErrorDistutilsPlatformError CompileErrorLibError LinkError) CCompilergen_lib_options)log) get_platform)countcj tjtjdtjtjz}n%#t $rt jdYdSwxYwd}d}|5tD]} tj ||\}}}n#t $rYn{wxYw|rt|tj krdtj |rE tt|}n#t t"f$rYwxYw|dkr ||kr||}}dddn #1swxYwY||fS)Nz'Software\Microsoft\VisualStudio\SxS\VC7)accesszVisual C++ is not registeredNNr)winreg OpenKeyExHKEY_LOCAL_MACHINEKEY_READKEY_WOW64_32KEYOSErrorr debugr EnumValueREG_SZospathisdirintfloat ValueError TypeError)key best_versionbest_dirivvc_dirvtversions /builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/setuptools/_distutils/_msvccompiler.py _find_vc2015r+'s  % 6?V%;;     0111zzLH = = = =A  & 0a 8 8 622     =R6=((RW]]6-B-B(!%((mmGG"I.Hb==W|%;%;-4f(L = = = = = = = = = = = = = = =  !!si8;AA&D&8BD& B D&B  4D&C21D&2DD&DD&&D*-D*c tjdptjd}|sdS tjtj|dddddd d d d d dg dd}n##tjttf$rYdSwxYwtj|ddd}tj |rd|fSdS)aJReturns "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. zProgramFiles(x86) ProgramFilesrzMicrosoft Visual Studio Installerz vswhere.exez-latestz -prereleasez -requiresz1Microsoft.VisualStudio.Component.VC.Tools.x86.x64z -propertyinstallationPathz -products*mbcsstrict)encodingerrorsVC AuxiliaryBuild) renvironget subprocess check_outputrjoinstripCalledProcessErrorrUnicodeDecodeErrorr)rootrs r* _find_vc2017rBDs :>>- . . P"*..2P2PD z& 3[-C"    %''! "  )74F Gzz 7<<dK 9 9D w}}T4x :sABB76B7x86x64armarm64)rC x86_amd64x86_arm x86_arm64c.t\}}|st\}}|stjddStj|d}tj|stjd|dS|dfS)Nz$No suitable Visual C++ version foundrz vcvarsall.batz%s cannot be found)rBr+r rrrr=isfile) plat_spec_r$r# vcvarsalls r*_find_vcvarsallrOvs..KAx 0!- h  8999z X77I 7>>) $ $ & 222z d?ctjdr(dtjDSt |\}}|st d t jd|d|dt j dd }nG#t j $r5}tj |j t d |jd}~wwxYwd d |DD}|S)NDISTUTILS_USE_SDKc>i|]\}}||Slower).0r"values r* z_get_vc_env..s&HHHzsE UHHHrPzUnable to find vcvarsall.batz cmd /u /c "z" z && set)stderrzutf-16lereplace)r4zError executing cHi|]\}}}|| || SrTrU)rWr"rMrXs r*rYz_get_vc_env..sH    CE    U   rPc3@K|]}|dVdS)=N) partition)rWlines r* z_get_vc_env..s.OOddnnS11OOOOOOrP)rgetenvr9itemsrOrr;r<STDOUTdecoder?r erroroutputcmd splitlines)rLrNrMoutexcenvs r* _get_vc_envrmsB y$%%IHHRZ5E5E5G5GHHHH"9--LIq E$%CDDDC% 9) 9 9y 9 9 9$    &I& . .   (CCC #*$%A%A%ABBBC  OOcnn>N>NOOO   C Js!>"   III  JrPrGrHrI)win32z win-amd64z win-arm32z win-arm64cJeZdZdZdZiZdgZgdZdgZdgZ eezeze zZ dZ dZ d Z d Zd xZZd Zdfd ZedZedZddZefdZ ddZ d dZ d!dZfdZejfdZ dZ!dZ"dZ#d"dZ$xZ%S)# MSVCCompilerztConcrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.msvcz.c)z.ccz.cppz.cxx.rcz.mcz.resz.objz.libz.dllz%s%sz.exercjt|||d|_d|_dS)NF)super__init__ plat_name initialized)selfverbosedry_runforce __class__s r*r~zMSVCCompiler.__init__s4 '5111 rPc||dd|_||dd|_dS)z3 Set class-level include/lib dirs. includelibN) _parse_pathr: include_dirs library_dirs)clsvc_envs r* _configurezMSVCCompiler._configuresN ??6::i+D+DEE??6::eR+@+@AArPcTd|tjDS)NcPg|]#}||tj$SrT)rstriprsep)rWdirs r* z,MSVCCompiler._parse_path..s+KKKssK 26""KKKrP)rorrp)vals r*rzMSVCCompiler._parse_paths$KKcii .C.CKKKKrPNc|jr Jd|t}|tvr$tdt tt|}t |}|std|||dd|_|j tj }td||_ td||_td||_td ||_td ||_td ||_d|_gd |_gd |_gd}gd}g|d|_g|d|_g|ddd|_g|ddd|_g||_g||_t8jdf|jt8jdf|jt8jdf|jt8jdf|jt8jdf|jt8jdf|jt8jdf|jt8jdf|jt8jdf|ji |_ d|_dS)Nzdon't init multiple timesz--plat-name must be one of z7Unable to find a compatible Visual Studio installation.rrzcl.exezlink.exezlib.exezrc.exezmc.exezmt.exe)/nologoz/O2/W3z/GLz/DNDEBUGz/MD)rz/Odz/MDdz/Zirz/D_DEBUG)r/INCREMENTAL:NO/LTCG)rrrz /DEBUG:FULLz/MANIFEST:EMBED,ID=1z/DLLz/MANIFEST:EMBED,ID=2z/MANIFESTUAC:NOFT)!rr PLAT_TO_VCVARSrtuplermrr:_pathsrorrprvcclinkerrrcmcmtpreprocess_optionscompile_optionscompile_options_debug ldflags_exeldflags_exe_debugldflags_sharedldflags_shared_debugldflags_staticldflags_static_debugr EXECUTABLE SHARED_OBJECTSHARED_LIBRARY_ldflags)rrrLrrsldflags ldflags_debugs r* initializezMSVCCompiler.initializes#@@%@@@#  $I N * *(EeN.C.CEE  #9- Y'' (L  jj,,  !!"*--He,, E22 Y..He,,He,,He,,"& SRR& & & ":99NNN =W=&<=!I=!I2H!I    #     % % %  #%   % ! )j$4m$4! !4 ($*:  !5 )4+;  !4 ($*@  $d +T-@  $e ,d.A  $d +T-F  %t ,d.A  %u -t/B  %t ,d.G    rPcfitjfdjjzDS)Nc i|] }|j SrT) res_extension)rWextrs r*rYz/MSVCCompiler.out_extensions..Es.T'rP)r}out_extensions_rc_extensions_mc_extensions)rrs`r*rzMSVCCompiler.out_extensionsAsS gg$ .1DD  rPc |js||||||||} | \}} }} } |pg} | d|r| |jn| |jd}| D]i} | |\}}n#t$rYwxYw|rtj |}||j vrd|z}n||j vr d|z}d}n{||j vrN|}d|z} ||jg| z||gzn!#t $r}t#|d}~wwxYw||jvrtj |}tj |} ||jd|d||gtj tj |\}}tj ||d z}||jd|z|gn!#t $r}t#|d}~wwxYwt#d |d ||jg| z| z}|r|d ||d |zf|| ||J#t $r}t#|d}~wwxYw| S)Nz/cFz/Tcz/TpTz/foz-hz-rr{zDon't know how to compile z to z/EHscz/Fo)rr_setup_compileappendextendrrKeyErrorrrrq _c_extensions_cpp_extensionsrspawnrrrrdirnamersplitextbasenamer=r)rsources output_dirmacrosrr extra_preargsextra_postargsdepends compile_infoobjectspp_optsbuild compile_opts add_cpp_optsobjsrcr input_opt output_optmsgh_dirrc_dirbaserMrc_fileargss r*compilezMSVCCompiler.compileKsy  OO   **  gw  ;G7%$* D!!!  6    : ; ; ; ;    4 5 5 5 ? (? (C  :SS     +gooc**d(((!CK ,,,!CK # +++ "S[ ,JJy72j)5LLMMMM),,,&s+++,+++,,-- ,JJudFCHIII g..rw/?/?/D/DEEGD! gll64%<@@GJJg>????),,,&s+++,##N#N#N#N#NOOOG9|+g5D % G$$$ KKECK0 1 1 1 KK ' ' ' ( 4    % ( ( ("3''' (s[ B"" B/.B/#D** E4EEB"H88 IIIK K:&K55K:c|js||||\}}|||}|||r||d|zgz}|r t jd|jd|| |jg|zdS#t$r}t|d}~wwxYwt jd|dS)N)r/OUT:Executing "%s" %s skipping %s (up-to-date)) rr_fix_object_argslibrary_filename _need_linkr rrr=rrr) rroutput_libnamerr target_langoutput_filenamelib_argsrs r*create_static_libzMSVCCompiler.create_static_libs  OO   "33GZHH//:/VV ??7O 4 4 C'O";!<.sNNN:+NNNrPrrz/IMPLIB:rrr)rrr _fix_lib_argswarnstrr rrr=rrrrrrrrrqmkpathr rrrrr)r target_descrrr librariesrruntime_library_dirsexport_symbolsrrr build_tempr fixed_argslib_optsr export_optsld_argsdll_namedll_ext implib_filers r*linkzMSVCCompiler.links   OO   "33GZHH'' W=XX 44J)&(g&6&6G$$_55''#7!gll:t7L7LX7V7VWW zK7888 ,+  /~...)I)IJJJ KK # # # % -t{CHHWFallback spawn triggered. Please update distutils monkeypatch.z os.environ) typer!rwarningsrmockpatchrr}rrX)rrhrlbagrkrs r*rzMSVCCompiler._fallback_spawns""d5"b!!## III F    2#c((BBCBBBB   VWWW Z__\3 / / + + c**CI + + + + + + + + + + + + + + + + + +s&$ A AA 'B55B9<B9c d|zS)Nz /LIBPATH:rTrrs r*library_dir_optionzMSVCCompiler.library_dir_options S  rPc td)Nz:don't know how to set runtime library search path for MSVC)rr s r*runtime_library_dir_optionz'MSVCCompiler.runtime_library_dir_option"s$ H   rPc,||SN)r)rrs r*library_optionzMSVCCompiler.library_option's$$S)))rPc|r|dz|g}n|g}|D]_}|D]Z}tj|||}tj|r|ccS[`dS)N_d)rrr=rrK)rdirsrr try_namesrnamelibfiles r*find_library_filezMSVCCompiler.find_library_file*s  tS)III  C! # #',,sD,A,A$,G,GHH7>>'**#"NNNNN# # 4rP)rrrr)NNNrNNN)NrN) NNNNNrNNNN)r)&__name__ __module__ __qualname____doc__ compiler_type executablesrrrrsrc_extensionsr obj_extensionstatic_lib_extensionshared_lib_extensionstatic_lib_formatshared_lib_format exe_extensionr~ classmethodr staticmethodrrpropertyrrrrr contextlibcontextmanagerrr rrr __classcell__)rs@r*ryrys=33MKFM---OWNWN#_4~EVNMM!!,22)M!!!!!! BB[BLL\LN N N N d    X \\\\~NRCCCC2!CCCCCCCCJ +++++,!!!   ***rPryr)!rrr;r)r unittest.mockrsuppress ImportErrorrr4rrrrr ccompilerr r _logr utilr itertoolsr r+rBPLAT_SPEC_TO_RUNTIMErOrmrvrryrTrPr*r4s Z%%MMM21111111""":'''V  &4, xxxxx9xxxxxs :>>