Browse Source

Merge branch 'rightlib' into merge-libs-250217-0050

Alexander Smirnov 3 weeks ago
parent
commit
53cf150a37

+ 1 - 0
contrib/tools/python3/.yandex_meta/__init__.py

@@ -256,6 +256,7 @@ python3 = NixSourceProject(
         "sys/byteorder.h",
         "sys/lwp.h",
         "sys/memfd.h",
+        "sys/pidfd.h",
         # ifdef __VXWORKS__
         "rtpLib.h",
         "taskLib.h",

+ 2 - 2
contrib/tools/python3/.yandex_meta/override.nix

@@ -1,11 +1,11 @@
 pkgs: attrs: with pkgs; with attrs; rec {
-  version = "3.12.8";
+  version = "3.12.9";
 
   src = fetchFromGitHub {
     owner = "python";
     repo = "cpython";
     rev = "v${version}";
-    hash = "sha256-1Z2SMEut5YY9tTtrzPpmXcsIQKw5MGcGI4l0ysJbg28=";
+    hash = "sha256-5Hl+kKhavxihPmxVOyzUpchxiYMfYRfcjTbjiIq1i1o=";
   };
 
   patches = [];

+ 1 - 1
contrib/tools/python3/Include/cpython/pytime.h

@@ -53,7 +53,7 @@ functions and constants
 extern "C" {
 #endif
 
-#ifdef __clang__
+#if defined(__clang__) || defined(_MSC_VER)
 struct timeval;
 #endif
 

+ 5 - 0
contrib/tools/python3/Include/internal/pycore_object.h

@@ -65,6 +65,11 @@ static inline void _Py_RefcntAdd(PyObject* op, Py_ssize_t n)
     _Py_AddRefTotal(_PyInterpreterState_GET(), n);
 #endif
     op->ob_refcnt += n;
+
+    // Although the ref count was increased by `n` (which may be greater than 1)
+    // it is only a single increment (i.e. addition) operation, so only 1 refcnt
+    // increment operation is counted.
+    _Py_INCREF_STAT_INC();
 }
 #define _Py_RefcntAdd(op, n) _Py_RefcntAdd(_PyObject_CAST(op), n)
 

+ 12 - 0
contrib/tools/python3/Include/internal/pycore_pyerrors.h

@@ -75,6 +75,18 @@ PyAPI_FUNC(void) _PyErr_SetString(
     PyObject *exception,
     const char *string);
 
+/*
+ * Set an exception with the error message decoded from the current locale
+ * encoding (LC_CTYPE).
+ *
+ * Exceptions occurring in decoding take priority over the desired exception.
+ *
+ * Exported for '_ctypes' shared extensions.
+ */
+PyAPI_FUNC(void) _PyErr_SetLocaleString(
+    PyObject *exception,
+    const char *string);
+
 PyAPI_FUNC(PyObject *) _PyErr_Format(
     PyThreadState *tstate,
     PyObject *exception,

+ 2 - 2
contrib/tools/python3/Include/patchlevel.h

@@ -18,12 +18,12 @@
 /*--start constants--*/
 #define PY_MAJOR_VERSION        3
 #define PY_MINOR_VERSION        12
-#define PY_MICRO_VERSION        8
+#define PY_MICRO_VERSION        9
 #define PY_RELEASE_LEVEL        PY_RELEASE_LEVEL_FINAL
 #define PY_RELEASE_SERIAL       0
 
 /* Version as a string */
-#define PY_VERSION              "3.12.8"
+#define PY_VERSION              "3.12.9"
 /*--end constants--*/
 
 /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2.

+ 5 - 6
contrib/tools/python3/Include/pyconfig-linux.h

@@ -48,10 +48,6 @@
 /* Define if --enable-ipv6 is specified */
 #define ENABLE_IPV6 1
 
-/* Define to 1 if your system stores words within floats with the most
-   significant word first */
-/* #undef FLOAT_WORDS_BIGENDIAN */
-
 /* Define if getpgrp() must be called as getpgrp(0). */
 /* #undef GETPGRP_HAVE_ARG */
 
@@ -1339,6 +1335,9 @@
 /* Define to 1 if you have the <sys/param.h> header file. */
 #define HAVE_SYS_PARAM_H 1
 
+/* Define to 1 if you have the <sys/pidfd.h> header file. */
+/* #undef HAVE_SYS_PIDFD_H */
+
 /* Define to 1 if you have the <sys/poll.h> header file. */
 #define HAVE_SYS_POLL_H 1
 
@@ -1439,8 +1438,8 @@
 /* Define to 1 if you have the `truncate' function. */
 #define HAVE_TRUNCATE 1
 
-/* Define to 1 if you have the `ttyname' function. */
-#define HAVE_TTYNAME 1
+/* Define to 1 if you have the `ttyname_r' function. */
+#define HAVE_TTYNAME_R 1
 
 /* Define to 1 if you don't have `tm_zone' but do have the external array
    `tzname'. */

+ 5 - 6
contrib/tools/python3/Include/pyconfig-osx-arm64.h

@@ -48,10 +48,6 @@
 /* Define if --enable-ipv6 is specified */
 #define ENABLE_IPV6 1
 
-/* Define to 1 if your system stores words within floats with the most
-   significant word first */
-/* #undef FLOAT_WORDS_BIGENDIAN */
-
 /* Define if getpgrp() must be called as getpgrp(0). */
 /* #undef GETPGRP_HAVE_ARG */
 
@@ -1337,6 +1333,9 @@
 /* Define to 1 if you have the <sys/param.h> header file. */
 #define HAVE_SYS_PARAM_H 1
 
+/* Define to 1 if you have the <sys/pidfd.h> header file. */
+/* #undef HAVE_SYS_PIDFD_H */
+
 /* Define to 1 if you have the <sys/poll.h> header file. */
 #define HAVE_SYS_POLL_H 1
 
@@ -1437,8 +1436,8 @@
 /* Define to 1 if you have the `truncate' function. */
 #define HAVE_TRUNCATE 1
 
-/* Define to 1 if you have the `ttyname' function. */
-#define HAVE_TTYNAME 1
+/* Define to 1 if you have the `ttyname_r' function. */
+#define HAVE_TTYNAME_R 1
 
 /* Define to 1 if you don't have `tm_zone' but do have the external array
    `tzname'. */

+ 9 - 0
contrib/tools/python3/Include/pymacro.h

@@ -118,6 +118,15 @@
  */
 #if defined(__GNUC__) || defined(__clang__)
 #  define Py_UNUSED(name) _unused_ ## name __attribute__((unused))
+#elif defined(_MSC_VER)
+   // Disable warning C4100: unreferenced formal parameter,
+   // declare the parameter,
+   // restore old compiler warnings.
+#  define Py_UNUSED(name) \
+        __pragma(warning(push)) \
+        __pragma(warning(suppress: 4100)) \
+        _unused_ ## name \
+        __pragma(warning(pop))
 #else
 #  define Py_UNUSED(name) _unused_ ## name
 #endif

+ 8 - 3
contrib/tools/python3/Include/tracemalloc.h

@@ -1,7 +1,10 @@
 #ifndef Py_TRACEMALLOC_H
 #define Py_TRACEMALLOC_H
-
 #ifndef Py_LIMITED_API
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /* Track an allocated memory block in the tracemalloc module.
    Return 0 on success, return -1 on error (failed to allocate memory to store
    the trace).
@@ -47,7 +50,7 @@ PyAPI_FUNC(PyObject *) _PyTraceMalloc_GetTraces(void);
 PyAPI_FUNC(PyObject *) _PyTraceMalloc_GetObjectTraceback(PyObject *obj);
 
 /* Initialize tracemalloc */
-PyAPI_FUNC(int) _PyTraceMalloc_Init(void);
+PyAPI_FUNC(PyStatus) _PyTraceMalloc_Init(void);
 
 /* Start tracemalloc */
 PyAPI_FUNC(int) _PyTraceMalloc_Start(int max_nframe);
@@ -67,6 +70,8 @@ PyAPI_FUNC(PyObject *) _PyTraceMalloc_GetTracedMemory(void);
 /* Set the peak size of traced memory blocks to the current size */
 PyAPI_FUNC(void) _PyTraceMalloc_ResetPeak(void);
 
+#ifdef __cplusplus
+}
 #endif
-
+#endif /* !Py_LIMITED_API */
 #endif /* !Py_TRACEMALLOC_H */

Some files were not shown because too many files changed in this diff