diff options
| author | maxim-yurchuk <[email protected]> | 2024-10-09 12:29:46 +0300 |
|---|---|---|
| committer | maxim-yurchuk <[email protected]> | 2024-10-09 13:14:22 +0300 |
| commit | 9731d8a4bb7ee2cc8554eaf133bb85498a4c7d80 (patch) | |
| tree | a8fb3181d5947c0d78cf402aa56e686130179049 /contrib/python/psutil/py3 | |
| parent | a44b779cd359f06c3ebbef4ec98c6b38609d9d85 (diff) | |
publishFullContrib: true for ydb
<HIDDEN_URL>
commit_hash:c82a80ac4594723cebf2c7387dec9c60217f603e
Diffstat (limited to 'contrib/python/psutil/py3')
6 files changed, 380 insertions, 0 deletions
diff --git a/contrib/python/psutil/py3/.yandex_meta/yamaker.yaml b/contrib/python/psutil/py3/.yandex_meta/yamaker.yaml new file mode 100644 index 00000000000..7659f66f4fc --- /dev/null +++ b/contrib/python/psutil/py3/.yandex_meta/yamaker.yaml @@ -0,0 +1,13 @@ +disable_includes: + - arch/aix/ifaddrs.h + - arch/solaris/v10/ifaddrs.h +exclude: + - psutil/_psutil_aix.c + - psutil/_psutil_bsd.c + - psutil/_psutil_sunos.c + - psutil/arch/aix/* + - psutil/arch/bsd/* + - psutil/arch/freebsd/* + - psutil/arch/netbsd/* + - psutil/arch/openbsd/* + - psutil/arch/solaris/* diff --git a/contrib/python/psutil/py3/patches/01-arcadia.patch b/contrib/python/psutil/py3/patches/01-arcadia.patch new file mode 100644 index 00000000000..54b53d1db5c --- /dev/null +++ b/contrib/python/psutil/py3/patches/01-arcadia.patch @@ -0,0 +1,24 @@ +--- contrib/python/psutil/py3/psutil/_pslinux.py (index) ++++ contrib/python/psutil/py3/psutil/_pslinux.py (working tree) +@@ -322,7 +322,10 @@ try: + except ImportError: + import ctypes + +- libc = ctypes.CDLL(None, use_errno=True) ++ try: ++ libc = ctypes.CDLL(None, use_errno=True) ++ except: ++ libc = None + + if hasattr(libc, "prlimit"): + +--- contrib/python/psutil/py3/psutil/arch/windows/disk.c (index) ++++ contrib/python/psutil/py3/psutil/arch/windows/disk.c (working tree) +@@ -7,6 +7,7 @@ + #include <Python.h> + #include <windows.h> + #include <tchar.h> ++#include <winioctl.h> + + #include "../../_psutil_common.h" + diff --git a/contrib/python/psutil/py3/patches/02-unaccepted-pr2064-missing-extern.patch b/contrib/python/psutil/py3/patches/02-unaccepted-pr2064-missing-extern.patch new file mode 100644 index 00000000000..7cb6242a78c --- /dev/null +++ b/contrib/python/psutil/py3/patches/02-unaccepted-pr2064-missing-extern.patch @@ -0,0 +1,190 @@ +commit a03e18c3d85dd0e4c50be4630afd5bf5cffd9a0e (HEAD -> ymake-refactoring) +author: thegeorg +date: 2022-01-24T14:25:44+03:00 + + Make psutil compile with -fno-common + +--- contrib/python/psutil/py3/psutil/_psutil_common.c (dd7c6db013778a31c03086c567edb72a9dfa4604) ++++ contrib/python/psutil/py3/psutil/_psutil_common.c (a03e18c3d85dd0e4c50be4630afd5bf5cffd9a0e) +@@ -7,6 +7,7 @@ + */ + + #include <Python.h> ++#define PSUTIL_MAYBE_EXTERN + #include "_psutil_common.h" + + // ==================================================================== +--- contrib/python/psutil/py3/psutil/arch/windows/ntextapi.h (dd7c6db013778a31c03086c567edb72a9dfa4604) ++++ contrib/python/psutil/py3/psutil/arch/windows/ntextapi.h (a03e18c3d85dd0e4c50be4630afd5bf5cffd9a0e) +@@ -10,6 +10,10 @@ + #include <winternl.h> + #include <iphlpapi.h> + ++#ifndef PSUTIL_MAYBE_EXTERN ++#define PSUTIL_MAYBE_EXTERN extern ++#endif ++ + typedef LONG NTSTATUS; + + // https://github.com/ajkhoury/TestDll/blob/master/nt_ddk.h +@@ -550,14 +554,14 @@ typedef struct { + // Type defs for modules loaded at runtime. + // ================================================================ + +-BOOL (WINAPI *_GetLogicalProcessorInformationEx) ( ++PSUTIL_MAYBE_EXTERN BOOL (WINAPI *_GetLogicalProcessorInformationEx) ( + LOGICAL_PROCESSOR_RELATIONSHIP relationship, + PSYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX Buffer, + PDWORD ReturnLength); + + #define GetLogicalProcessorInformationEx _GetLogicalProcessorInformationEx + +-BOOLEAN (WINAPI * _WinStationQueryInformationW) ( ++PSUTIL_MAYBE_EXTERN BOOLEAN (WINAPI * _WinStationQueryInformationW) ( + HANDLE ServerHandle, + ULONG SessionId, + WINSTATIONINFOCLASS WinStationInformationClass, +@@ -567,7 +571,7 @@ BOOLEAN (WINAPI * _WinStationQueryInformationW) ( + + #define WinStationQueryInformationW _WinStationQueryInformationW + +-NTSTATUS (NTAPI *_NtQueryInformationProcess) ( ++PSUTIL_MAYBE_EXTERN NTSTATUS (NTAPI *_NtQueryInformationProcess) ( + HANDLE ProcessHandle, + DWORD ProcessInformationClass, + PVOID ProcessInformation, +@@ -576,7 +580,7 @@ NTSTATUS (NTAPI *_NtQueryInformationProcess) ( + + #define NtQueryInformationProcess _NtQueryInformationProcess + +-NTSTATUS (NTAPI *_NtQuerySystemInformation) ( ++PSUTIL_MAYBE_EXTERN NTSTATUS (NTAPI *_NtQuerySystemInformation) ( + ULONG SystemInformationClass, + PVOID SystemInformation, + ULONG SystemInformationLength, +@@ -584,7 +588,7 @@ NTSTATUS (NTAPI *_NtQuerySystemInformation) ( + + #define NtQuerySystemInformation _NtQuerySystemInformation + +-NTSTATUS (NTAPI *_NtSetInformationProcess) ( ++PSUTIL_MAYBE_EXTERN NTSTATUS (NTAPI *_NtSetInformationProcess) ( + HANDLE ProcessHandle, + DWORD ProcessInformationClass, + PVOID ProcessInformation, +@@ -592,19 +596,19 @@ NTSTATUS (NTAPI *_NtSetInformationProcess) ( + + #define NtSetInformationProcess _NtSetInformationProcess + +-PSTR (NTAPI * _RtlIpv4AddressToStringA) ( ++PSUTIL_MAYBE_EXTERN PSTR (NTAPI * _RtlIpv4AddressToStringA) ( + struct in_addr *Addr, + PSTR S); + + #define RtlIpv4AddressToStringA _RtlIpv4AddressToStringA + +-PSTR (NTAPI * _RtlIpv6AddressToStringA) ( ++PSUTIL_MAYBE_EXTERN PSTR (NTAPI * _RtlIpv6AddressToStringA) ( + struct in6_addr *Addr, + PSTR P); + + #define RtlIpv6AddressToStringA _RtlIpv6AddressToStringA + +-DWORD (WINAPI * _GetExtendedTcpTable) ( ++PSUTIL_MAYBE_EXTERN DWORD (WINAPI * _GetExtendedTcpTable) ( + PVOID pTcpTable, + PDWORD pdwSize, + BOOL bOrder, +@@ -614,7 +618,7 @@ DWORD (WINAPI * _GetExtendedTcpTable) ( + + #define GetExtendedTcpTable _GetExtendedTcpTable + +-DWORD (WINAPI * _GetExtendedUdpTable) ( ++PSUTIL_MAYBE_EXTERN DWORD (WINAPI * _GetExtendedUdpTable) ( + PVOID pUdpTable, + PDWORD pdwSize, + BOOL bOrder, +@@ -624,12 +628,12 @@ DWORD (WINAPI * _GetExtendedUdpTable) ( + + #define GetExtendedUdpTable _GetExtendedUdpTable + +-DWORD (CALLBACK *_GetActiveProcessorCount) ( ++PSUTIL_MAYBE_EXTERN DWORD (CALLBACK *_GetActiveProcessorCount) ( + WORD GroupNumber); + + #define GetActiveProcessorCount _GetActiveProcessorCount + +-BOOL(CALLBACK *_WTSQuerySessionInformationW) ( ++PSUTIL_MAYBE_EXTERN BOOL(CALLBACK *_WTSQuerySessionInformationW) ( + HANDLE hServer, + DWORD SessionId, + WTS_INFO_CLASS WTSInfoClass, +@@ -639,7 +643,7 @@ BOOL(CALLBACK *_WTSQuerySessionInformationW) ( + + #define WTSQuerySessionInformationW _WTSQuerySessionInformationW + +-BOOL(CALLBACK *_WTSEnumerateSessionsW)( ++PSUTIL_MAYBE_EXTERN BOOL(CALLBACK *_WTSEnumerateSessionsW)( + HANDLE hServer, + DWORD Reserved, + DWORD Version, +@@ -649,18 +653,18 @@ BOOL(CALLBACK *_WTSEnumerateSessionsW)( + + #define WTSEnumerateSessionsW _WTSEnumerateSessionsW + +-VOID(CALLBACK *_WTSFreeMemory)( ++PSUTIL_MAYBE_EXTERN VOID(CALLBACK *_WTSFreeMemory)( + IN PVOID pMemory + ); + + #define WTSFreeMemory _WTSFreeMemory + +-ULONGLONG (CALLBACK *_GetTickCount64) ( ++PSUTIL_MAYBE_EXTERN ULONGLONG (CALLBACK *_GetTickCount64) ( + void); + + #define GetTickCount64 _GetTickCount64 + +-NTSTATUS (NTAPI *_NtQueryObject) ( ++PSUTIL_MAYBE_EXTERN NTSTATUS (NTAPI *_NtQueryObject) ( + HANDLE Handle, + OBJECT_INFORMATION_CLASS ObjectInformationClass, + PVOID ObjectInformation, +@@ -669,25 +673,25 @@ NTSTATUS (NTAPI *_NtQueryObject) ( + + #define NtQueryObject _NtQueryObject + +-NTSTATUS (WINAPI *_RtlGetVersion) ( ++PSUTIL_MAYBE_EXTERN NTSTATUS (WINAPI *_RtlGetVersion) ( + PRTL_OSVERSIONINFOW lpVersionInformation + ); + + #define RtlGetVersion _RtlGetVersion + +-NTSTATUS (WINAPI *_NtResumeProcess) ( ++PSUTIL_MAYBE_EXTERN NTSTATUS (WINAPI *_NtResumeProcess) ( + HANDLE hProcess + ); + + #define NtResumeProcess _NtResumeProcess + +-NTSTATUS (WINAPI *_NtSuspendProcess) ( ++PSUTIL_MAYBE_EXTERN NTSTATUS (WINAPI *_NtSuspendProcess) ( + HANDLE hProcess + ); + + #define NtSuspendProcess _NtSuspendProcess + +-NTSTATUS (NTAPI *_NtQueryVirtualMemory) ( ++PSUTIL_MAYBE_EXTERN NTSTATUS (NTAPI *_NtQueryVirtualMemory) ( + HANDLE ProcessHandle, + PVOID BaseAddress, + int MemoryInformationClass, +@@ -698,7 +702,7 @@ NTSTATUS (NTAPI *_NtQueryVirtualMemory) ( + + #define NtQueryVirtualMemory _NtQueryVirtualMemory + +-ULONG (WINAPI *_RtlNtStatusToDosErrorNoTeb) ( ++PSUTIL_MAYBE_EXTERN ULONG (WINAPI *_RtlNtStatusToDosErrorNoTeb) ( + NTSTATUS status + ); + diff --git a/contrib/python/psutil/py3/patches/03-fix-build-on-win.patch b/contrib/python/psutil/py3/patches/03-fix-build-on-win.patch new file mode 100644 index 00000000000..bd6f7a9e6cd --- /dev/null +++ b/contrib/python/psutil/py3/patches/03-fix-build-on-win.patch @@ -0,0 +1,7 @@ +--- contrib/python/psutil/py3/psutil/arch/windows/proc.h (index) ++++ contrib/python/psutil/py3/psutil/arch/windows/proc.h (working tree) +@@ -9,2 +9,2 @@ +-PyObject *TimeoutExpired; +-PyObject *TimeoutAbandoned; ++extern PyObject *TimeoutExpired; ++extern PyObject *TimeoutAbandoned; diff --git a/contrib/python/psutil/py3/patches/04-fix-build-on-osx-arm64.patch b/contrib/python/psutil/py3/patches/04-fix-build-on-osx-arm64.patch new file mode 100644 index 00000000000..0d49690eaa1 --- /dev/null +++ b/contrib/python/psutil/py3/patches/04-fix-build-on-osx-arm64.patch @@ -0,0 +1,13 @@ +--- contrib/python/psutil/py3/psutil/arch/osx/cpu.c (index) ++++ contrib/python/psutil/py3/psutil/arch/osx/cpu.c (working tree) +@@ -31,6 +31,10 @@ For reference, here's the git history with original implementations: + #include <IOKit/IOKitLib.h> + #endif + ++#if (defined __MAC_OS_X_VERSION_MIN_REQUIRED) && (__MAC_OS_X_VERSION_MIN_REQUIRED < 120000) ++#define kIOMainPortDefault kIOMasterPortDefault ++#endif ++ + #include "../../_psutil_common.h" + #include "../../_psutil_posix.h" + diff --git a/contrib/python/psutil/py3/patches/99-fix-ya.make.patch b/contrib/python/psutil/py3/patches/99-fix-ya.make.patch new file mode 100644 index 00000000000..114f652aab7 --- /dev/null +++ b/contrib/python/psutil/py3/patches/99-fix-ya.make.patch @@ -0,0 +1,133 @@ +--- contrib/python/psutil/py3/ya.make (index) ++++ contrib/python/psutil/py3/ya.make (working tree) +@@ -32,6 +29,0 @@ CFLAGS( +- -DPSUTIL_POSIX=1 +- -DPSUTIL_LINUX=1 +- -DPSUTIL_POSIX=1 +- -DPSUTIL_OSX=1 +- -DPSUTIL_WINDOWS=1 +- -DPSUTIL_SIZEOF_PID_T=4 +@@ -42,30 +33,0 @@ SRCS( +- psutil/_psutil_linux.c +- psutil/_psutil_osx.c +- psutil/_psutil_posix.c +- psutil/_psutil_windows.c +- psutil/arch/linux/disk.c +- psutil/arch/linux/mem.c +- psutil/arch/linux/net.c +- psutil/arch/linux/proc.c +- psutil/arch/linux/users.c +- psutil/arch/osx/cpu.c +- psutil/arch/osx/disk.c +- psutil/arch/osx/mem.c +- psutil/arch/osx/net.c +- psutil/arch/osx/proc.c +- psutil/arch/osx/sensors.c +- psutil/arch/osx/sys.c +- psutil/arch/windows/cpu.c +- psutil/arch/windows/disk.c +- psutil/arch/windows/mem.c +- psutil/arch/windows/net.c +- psutil/arch/windows/proc.c +- psutil/arch/windows/proc_handles.c +- psutil/arch/windows/proc_info.c +- psutil/arch/windows/proc_utils.c +- psutil/arch/windows/security.c +- psutil/arch/windows/sensors.c +- psutil/arch/windows/services.c +- psutil/arch/windows/socks.c +- psutil/arch/windows/sys.c +- psutil/arch/windows/wmi.c +@@ -74,6 +36,86 @@ SRCS( +-PY_REGISTER( +- psutil._psutil_linux +- psutil._psutil_osx +- psutil._psutil_posix +- psutil._psutil_windows +-) ++IF (OS_LINUX) ++ CFLAGS( ++ -DPSUTIL_POSIX=1 ++ -DPSUTIL_LINUX=1 ++ ) ++ ++ SRCS( ++ psutil/_psutil_linux.c ++ psutil/_psutil_posix.c ++ psutil/arch/linux/disk.c ++ psutil/arch/linux/mem.c ++ psutil/arch/linux/net.c ++ psutil/arch/linux/proc.c ++ psutil/arch/linux/users.c ++ ) ++ ++ PY_REGISTER( ++ psutil._psutil_linux ++ psutil._psutil_posix ++ ) ++ENDIF() ++ ++IF (OS_DARWIN) ++ CFLAGS( ++ -DPSUTIL_POSIX=1 ++ -DPSUTIL_OSX=1 ++ ) ++ ++ LDFLAGS( ++ -framework CoreFoundation ++ -framework IOKit ++ ) ++ ++ SRCS( ++ psutil/_psutil_osx.c ++ psutil/_psutil_posix.c ++ psutil/arch/osx/cpu.c ++ psutil/arch/osx/disk.c ++ psutil/arch/osx/mem.c ++ psutil/arch/osx/net.c ++ psutil/arch/osx/proc.c ++ psutil/arch/osx/sensors.c ++ psutil/arch/osx/sys.c ++ ) ++ ++ PY_REGISTER( ++ psutil._psutil_osx ++ psutil._psutil_posix ++ ) ++ENDIF() ++ ++IF (OS_WINDOWS) ++ CFLAGS( ++ -DPSUTIL_WINDOWS=1 ++ -DPSUTIL_SIZEOF_PID_T=4 ++ ) ++ ++ LDFLAGS( ++ Shell32.lib ++ PowrProf.lib ++ Wtsapi32.lib ++ Pdh.lib ++ ) ++ ++ SRCS( ++ psutil/_psutil_windows.c ++ psutil/arch/windows/cpu.c ++ psutil/arch/windows/disk.c ++ psutil/arch/windows/mem.c ++ psutil/arch/windows/net.c ++ psutil/arch/windows/proc.c ++ psutil/arch/windows/proc_handles.c ++ psutil/arch/windows/proc_info.c ++ psutil/arch/windows/proc_utils.c ++ psutil/arch/windows/security.c ++ psutil/arch/windows/sensors.c ++ psutil/arch/windows/services.c ++ psutil/arch/windows/socks.c ++ psutil/arch/windows/sys.c ++ psutil/arch/windows/wmi.c ++ ) ++ ++ PY_REGISTER( ++ psutil._psutil_windows ++ ) ++ENDIF() |
