HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /proc/1780863/root/usr/lib/python3/dist-packages/gyp/__pycache__/
Upload File :
Current File : //proc/1780863/root/usr/lib/python3/dist-packages/gyp/__pycache__/win_tool.cpython-311.pyc
�

�"Kb;5��\�dZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ej
�ej
�e
����Zejdej��Zd�ZGd�de��Zedkr(e	jee	jd	d�����dSdS)
zuUtility functions for Windows builds.

These functions are executed via gyp-win-tool when using the ninja generator.
�)�print_functionNz/OUT:(?P<out>.+)$c�|�t��}|�|��}|�tj|��dSdS�N)�WinTool�Dispatch�sys�exit)�args�executor�	exit_codes   �./usr/lib/python3/dist-packages/gyp/win_tool.py�mainrsB��
�Y�Y�(�����%�%�)����H�Y��������c�l�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�ZdS)rz�This class performs all the Windows tooling steps. The methods can either
  be executed directly, or dispatched from an argument list.c	�@�t|��dkrtd���|ddkrdSd}|D]_}t�|��}|rAt	jddd|�d	��tj��fz��}n�`|�dS||d
<dS)zWAllows to use a unique instance of mspdbsrv.exe per linker instead of a
    shared one.��Not enough argumentsrzlink.exeNz\W+�z%s_%d�out�_MSPDBSRV_ENDPOINT_)	�len�	Exception�_LINK_EXE_OUT_ARG�match�re�sub�group�os�getpid)�self�envr
�
endpoint_name�arg�ms      r
�_UseSeparateMspdbsrvzWinTool._UseSeparateMspdbsrv's����4�y�y�1�}�}��,�-�-�-��A�w�*����f��M�����
�
!�
!�#�
&�
&�a�	
����v�r��q�w�w�u�~�~�r�y�{�{�3�3�5�5�
�
���
���f�
"/�C����rc��t|��dkrtd���d|�|d��z}t||��|dd��S)z(Dispatches a string command to a method.rrzExec%srN)rr�_CommandifyName�getattr)r r
�methods   r
rzWinTool.DispatchBs[��
�4�y�y�1�}�}��,�-�-�-�
��,�,�T�!�W�5�5�
5�F� �7�4�� � �$�q�r�r�(�+�+rc�R�|����dd��S)z@Transforms a tool name like recursive-mirror to RecursiveMirror.�-r)�title�replace)r �name_strings  r
r'zWinTool._CommandifyNameJs$�������&�&�s�B�/�/�/rc��t|�����dd��d��}d�|D��}t|��S)z@Gets the saved environment from a file for a given architecture.N����c�:�g|]}|�dd����S)�=r)�split)�.0�items  r
�
<listcomp>z#WinTool._GetEnv.<locals>.<listcomp>Ts&��
0�
0�
0�$�4�:�:�c�1���
0�
0�
0r)�open�readr4�dict)r �arch�pairs�kvss    r
�_GetEnvzWinTool._GetEnvNsO��

��J�J�O�O���c�r�c�"�(�(��.�.�E�
0�
0�%�
0�
0�
0�C���9�9�rc�J�t|d�����dS)zSimple stamp command.�wN)r8�close)r �paths  r
�	ExecStampzWinTool.ExecStampWs"����s�O�O�������rc���tj�|��r�tj�|��rd�}t	j||���nRtj|tj��stj|tj
��tj|��tj�|��rt	j||��dSt	j
||��dS)z)Emulation of rm -rf out && cp -af in out.c��tj|tj��stj|tj��||��dSr)r�access�W_OK�chmod�stat�S_IWRITE)�fnrB�excinfos   r
�	_on_errorz.WinTool.ExecRecursiveMirror.<locals>._on_error_s?����4���)�)�*��H�T�4�=�)�)�)�
�"�T�(�(�(�(�(r)�onerrorN)rrB�exists�isdir�shutil�rmtreerFrGrHrIrJ�unlink�copytree�copy2)r �source�destrMs    r
�ExecRecursiveMirrorzWinTool.ExecRecursiveMirror[s���	�w�~�~�d���
�	����t�	�	��	�	�	�	�
�d�I�.�.�.�.�.��y��r�w�'�'�	(�
�(�4���
'�
'�
'�
�	�$����	�w�}�}�V���!��o�f�d�#�#�#�#�#��l�6�4� � � � � rc�^�|�|��}|dkr|�||��tjdkr.t	|��}|d�dd��|d<t
j|tjdk|tjtj	d���}|�
��\}}|���D]P}|�d��s9|�d	��s$|�d
��st|���Q|jS)z�Filter diagnostic output from link that looks like:
    '   Creating library ui.dll.lib and object ui.dll.exp'
    This happens when there are exports from the dll or exe.
    �True�win32r�/�\T��shellr!�stdout�stderr�universal_newlinesz   Creating library zGenerating codezFinished generating code)r>r%r�platform�listr-�
subprocess�Popen�PIPE�STDOUT�communicate�
splitlines�
startswith�print�
returncode)	r r;�use_separate_mspdbsrvr
r!�linkr�_�lines	         r
�ExecLinkWrapperzWinTool.ExecLinkWrapperqs!��
�,�,�t�
�
�C���&�&�
����T�*�*�*�
�|�w���
�$�Z�Z�d��Q�����T�*�*�d�1�g���D����(?�S�#-�?�:�;L�/3�5�5�5�D��
�
�
�
�F�C����� � �����o�o�4�5�5���o�o�/�0�0���o�o�8�9�9��	�d������?�rc	��tj|||||||d�|	��d�	}
d}|	rPtjd|
z��|dkr3tjd|
z��tjd|
z��d|
z}tj||z��|	�r*tjd	|
z��d
|
z}d|
z}
t|
d��5}t|d��5}t
jd
d|�����}t
jd
d|�����}ddd��n#1swxYwYddd��n#1swxYwY||kretj
|��d�}||��||
��||��tj�d|�d|
�d|�d���dSdSdS)zZA wrapper for handling creating a manifest resource and then executing
    a link command.� )	�pythonr;r�ldcmd�resname�mt�rc�intermediate_manifest�	manifestsrzn%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo -manifest %(manifests)s -out:%(out)s.manifestrZz`%(python)s gyp-win-tool manifest-to-rc %(arch)s %(out)s.manifest %(out)s.manifest.rc %(resname)szF%(python)s gyp-win-tool rc-wrapper %(arch)s %(rc)s %(out)s.manifest.rcz %(out)s.manifest.resz�%(python)s gyp-win-tool manifest-wrapper %(arch)s %(mt)s -nologo -manifest %(out)s.manifest %(intermediate_manifest)s -out:%(out)s.assert.manifestz%(out)s.assert.manifestz%(out)s.manifest�rz\s+Nc�T�t|tj���tdtj���t|d��5}t|���tj���tdtj���ddd��dS#1swxYwYdS)N)�filez-----r|)rlrrar8r9)�filename�fs  r
�dumpz+WinTool.ExecLinkWithManifests.<locals>.dump�s���
��s�z�
*�
*�
*�
*�
��c�j�
)�
)�
)�
)��H�c�"�"�,�a��!�&�&�(�(���,�,�,�,��'��
�+�+�+�+�,�,�,�,�,�,�,�,�,�,�,�,����,�,�,�,�,�,s�A	B�B!�$B!zLinker generated manifest "z" added to final manifest "z" (result in "z8"). Were /MANIFEST switches used in #pragma statements? r)
r�
executable�joinre�
check_callr8rrr9rrSra�write)r r;�embed_manifestrrvrwrxryrzr{�	variables�	add_to_ld�assert_manifest�our_manifest�our_f�assert_f�our_data�assert_datar�s                   r
�ExecLinkWithManifestszWinTool.ExecLinkWithManifests�s������
�����4��8�8�I�&�&�
�
�I��I��8���:�<E�F�G�G�G�
�6�	!�	!���
-�/8�
9�	:�	:�	:�	��
"�$-�
.�	/�	/�	/�,�i�7�	���%�)�+�,�,�,�����)�+4�5�6�6�6�2�I�=�o�'�)�3�l���c�"�"�<�e�
�/�3�
'�
'�	<�8��V�F�B��
�
���5�5�(���v�r�8�=�=�?�?�;�;�+�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<�	<����	<�	<�	<�	<�<�<�<�<�<�<�<�<�<�<�<����<�<�<�<�
�[�	 �	 �
�	�#����	,�	,�	,�	
��
"�#�#�#���\������_�����
����$�#�#�\�\�\�?�?�?�
D�	E�	E�	E�
�q�?��
!�	 s7�	E�AD7�+E�7D;	�;E�>D;	�?E�E�Ec��|�|��}tj|d|tjtjd���}|���\}}|���D]}|rd|vrt|���|jS)z�Run manifest tool with environment set. Strip out undesirable warning
    (some XML blocks are recognized by the OS loader, but not the manifest
    tool).Tr^z#manifest authoring warning 81010002)	r>rerfrgrhrirjrlrm�r r;r
r!�popenrrprqs        r
�ExecManifestWrapperzWinTool.ExecManifestWrapper�s����,�,�t�
�
�C���T��3�$.�O�J�<M�04�
6�
6�
6�E��
�
�
 �
 �F�C����� � ����	
��7�t�C�C�
�d�������rc
��|\}}}t|d��5}|�d|�dtj�|���dd���d���ddd��dS#1swxYwYdS)z�Creates a resource file pointing a SxS assembly manifest.
    |args| is tuple containing path to resource file, path to manifest file
    and resource name which can be "1" (for executables) or "2" (for DLLs).r@z#include <windows.h>
z RT_MANIFEST "r]r\�"N)r8r�rrB�abspathr-)r r;r
�
manifest_path�
resource_path�
resource_name�outputs       r
�ExecManifestToRczWinTool.ExecManifestToRc�s���37�/�M�=�-�	
�m�S�	!�	!�<�V��l�l�l��
�
�
����
�&�&�.�.�t�S�9�9�9�9�;�<�<�<�<�<�<�<�<�<�<�<�<�<�<�<����<�<�<�<�<�<s�AA2�2A6�9A6c	����ddgt|	��zd|d|d|d|d|d||g
z}
|�|��}tj|
d	|tjtjd	�
��}|���\}
}|
���}d�t�fd�|D����}|D]*}|�	���s||vrt|���+|jS)
zjFilter noisy filenames output from MIDL compile step that isn't
    quietable via command line flags.
    �midlz/nologoz/outz/tlbz/hz/dlldataz/iidz/proxyTr^)zProcessing z64 bit Processing c3��K�|]8}|�����tj�|��V��9dSr)rkrrB�basename)r5�x�prefixess  �r
�	<genexpr>z*WinTool.ExecMidlWrapper.<locals>.<genexpr>
sW�����?�?��q�|�|�H�'=�'=�?�R�W�%�%�a�(�(�?�?�?�?�?�?r)rdr>rerfrgrhrirj�setrkrlrm)r r;�outdir�tlb�h�dlldata�iid�proxy�idl�flagsr
r!r�rrp�lines�
processingrqr�s                  @r
�ExecMidlWrapperzWinTool.ExecMidlWrapper�s&���

�I���e���,������a��G����%��0
�
�D��,�,�t�
�
�C���T��3�$.�O�J�<M�04�
6�
6�
6�E��
�
�
 �
 �F�C��

�N�N���E�4�H��?�?�?�?�#�?�?�?�?�?�J�����
�_�_�X�
&�
&��4�z�+A�+A�
�d�������rc��|�|��}tj|d|tjtjd���}|���\}}|���D]R}|�d��s;|�d��s&|�d��s|rt|���S|j	S)z/Filter logo banner from invocations of asm.exe.Tr^�#Copyright (C) Microsoft CorporationzMicrosoft (R) Macro Assemblerz
 Assembling: �
r>rerfrgrhrirjrkrlrmr�s        r
�ExecAsmWrapperzWinTool.ExecAsmWrappers���
�,�,�t�
�
�C���T��3�$.�O�J�<M�04�
6�
6�
6�E��
�
�
 �
 �F�C����� � �����o�o�C�D�D���o�o�=�>�>���o�o�o�.�.����	�d�������rc�h�|�|��}tj|d|tjtjd���}|���\}}|���D]=}|�d��s&|�d��s|rt|���>|j	S)zgFilter logo banner from invocations of rc.exe. Older versions of RC
    don't support the /nologo flag.Tr^z+Microsoft (R) Windows (R) Resource Compilerr�r�r�s        r
�
ExecRcWrapperzWinTool.ExecRcWrapper#s����,�,�t�
�
�C���T��3�$.�O�J�<M�04�
6�
6�
6�E��
�
�
 �
 �F�C����� � �����o�o�K�L�L���o�o�C�D�D��
��	�d�������rc��|�|��}tj���D]\}}||vr|||<�t	|�����}|r|dnd}t
j|d||���S)z�Runs an action command line from a response file using the environment
    for |arch|. If |dir| is supplied, use that as the working directory.rNT)r_r!�cwd)r>r�environ�itemsr8r9re�call)r r;�rspfile�dirr!�k�vr
s        r
�ExecActionWrapperzWinTool.ExecActionWrapper2s����,�,�t�
�
�C��
� � �"�"�����1�	
�#�����A�����=�=�����D��
!�#�a�&�&�T�C��?�4�t��#�>�>�>�>rc���tj��t���|�d��}�fd�|D��}dg}|�|��t
j|dt���S)zfExecuted by msvs-ninja projects when the 'ClCompile' target is used to
    build selected C/C++ files.�;c�V��g|]%}tj��|��dz��&S)z^^)rrBr�)r5r�project_dirs  �r
r7z)WinTool.ExecClCompile.<locals>.<listcomp>Ds>���(�(�(���W�\�\�+�x�8�8�4�?�(�(�(rz	ninja.exeT)r_r�)rrB�relpath�BASE_DIRr4�extendrer�)r r��selected_files�
ninja_targets�cmds `   r
�
ExecClCompilezWinTool.ExecClCompile?s�����'�/�/�+�x�8�8�K�#�)�)�#�.�.�N�(�(�(�(�&�(�(�(�M��-�C��J�J�}�����?�3�d��9�9�9�9rN)�__name__�
__module__�__qualname__�__doc__r%rr'r>rCrXrrr�r�r�r�r�r�r�r��rr
rr#s������@�@�/�/�/�6,�,�,�0�0�0�������!�!�!�,���<L�L�L�\���<�<�<����>
�
�
�
�
�
�?�?�?�	:�	:�	:�	:�	:rr�__main__r)r��
__future__rrrrQrerI�stringrrB�dirnamer��__file__r��compile�
IGNORECASErr�objectrr�r	�argvr�rr
�<module>r�s"����
&�%�%�%�%�%�	�	�	�	�	�	�	�	�
�
�
�
���������
�
�
�
�
�
�
�
�
�7�?�?�2�7�?�?�8�4�4�5�5���B�J�2�B�M�B�B�����e:�e:�e:�e:�e:�f�e:�e:�e:�N	�z���
�#�(�4�4���������������r