python3.11: update to version 3.11.8. (#10110)

This commit is contained in:
OscarL
2024-02-16 07:27:27 -03:00
committed by GitHub
parent 58599b50af
commit eef3fd5c7a
3 changed files with 199 additions and 129 deletions

View File

@@ -1,4 +1,4 @@
From 03bcbc8084a4e2eb67a36152bdc4b1fc19cf5336 Mon Sep 17 00:00:00 2001
From 2f00459cfa8328da1ffc7767a464f91dea7b26f7 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Thu, 10 Apr 2014 16:03:33 +0000
Subject: initial Haiku patch
@@ -152,10 +152,10 @@ index 0000000..4372ee2
+set -v
+eval $PYTHON_FOR_BUILD ../../Tools/scripts/h2py.py -i "'(u_long)'" $HEADERS/posix/netinet/in.h
diff --git a/Lib/site.py b/Lib/site.py
index 69670d9..82ca5af 100644
index 2904e44..8face24 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -281,6 +281,14 @@ def _getuserbase():
@@ -291,6 +291,14 @@ def _getuserbase():
return joinuser("~", "Library", sys._framework,
"%d.%d" % sys.version_info[:2])
@@ -170,7 +170,7 @@ index 69670d9..82ca5af 100644
return joinuser("~", ".local")
@@ -361,7 +369,14 @@ def getsitepackages(prefixes=None):
@@ -371,7 +379,14 @@ def getsitepackages(prefixes=None):
continue
seen.add(prefix)
@@ -186,7 +186,7 @@ index 69670d9..82ca5af 100644
libdirs = [sys.platlibdir]
if sys.platlibdir != "lib":
libdirs.append("lib")
@@ -470,8 +485,16 @@ def enablerlcompleter():
@@ -480,8 +495,16 @@ def enablerlcompleter():
# each interpreter exit when readline was already configured
# through a PYTHONSTARTUP hook, see:
# http://bugs.python.org/issue5845#msg198636
@@ -218,7 +218,7 @@ index 5cc3d4b..6f53287 100644
# Somehow /dev/tty appears seekable on some BSDs
self.assertEqual(f.seekable(), False)
diff --git a/Makefile.pre.in b/Makefile.pre.in
index c61b093..86ec08d 100644
index 4d1921b..bf222f6 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -146,7 +146,7 @@ BINDIR= @bindir@
@@ -373,14 +373,14 @@ index 42123c9..60de40a 100644
2.42.1
From ce3528842c00cb3600f145306290c2d36f81ffbf Mon Sep 17 00:00:00 2001
From 9658e361a9cd24dac0c6ee7fc042c9015c8b8b60 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Sun, 16 Apr 2017 10:05:42 +0200
Subject: fix for negative errnos
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 6df5dd5..39dde15 100644
index 3264d9a..829477d 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1938,6 +1938,8 @@ class Popen:
@@ -389,14 +389,14 @@ index 6df5dd5..39dde15 100644
errno_num = int(hex_errno, 16)
+ if sys.platform.startswith('haiku'):
+ errno_num = -errno_num;
child_exec_never_called = (err_msg == "noexec")
if child_exec_never_called:
if err_msg == "noexec:chdir":
err_msg = ""
# The error must be from chdir(cwd).
diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c
index 072519c..1023c8a 100644
index d91bf21..cb6c6a2 100644
--- a/Modules/_posixsubprocess.c
+++ b/Modules/_posixsubprocess.c
@@ -724,6 +724,10 @@ error:
@@ -729,6 +729,10 @@ error:
char *cur;
_Py_write_noraise(errpipe_write, "OSError:", 8);
cur = hex_errno + sizeof(hex_errno);
@@ -411,17 +411,26 @@ index 072519c..1023c8a 100644
2.42.1
From 90213d89824d796d82fc5266f65c79a6787daaef Mon Sep 17 00:00:00 2001
From: Philippe Houdoin <philippe.houdoin@gmail.com>
Date: Wed, 24 May 2017 11:09:43 +0000
From ca76437963d002d811e83bb43012c0d5a8a665b7 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sun, 8 Oct 2023 20:06:31 -0300
Subject: Implement CTypes's find_library for Haiku
This combines:
- the original patch by Philippe Houdoin <philippe.houdoin@gmail.com>
- A slight variation of Adrien Destugues' fix for x86_gcc2.
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 0c2510e..2b4f04c 100644
index c550883..6b23423 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -265,6 +265,56 @@ elif os.name == "posix":
@@ -1,4 +1,5 @@
import os
+import platform
import shutil
import subprocess
import sys
@@ -268,6 +269,60 @@ elif os.name == "posix":
def find_library(name, is64 = False):
return _get_soname(_findLib_crle(name, is64) or _findLib_gcc(name))
@@ -446,6 +455,10 @@ index 0c2510e..2b4f04c 100644
+ directory = directory.replace('%A',
+ os.path.dirname(os.path.abspath(sys.argv[0] or os.getcwd())))
+
+ # Are we on x86 32 bits?:
+ if platform.machine() == 'BePC':
+ directory = os.path.join(directory, "x86")
+
+ if not os.path.isdir(directory):
+ continue
+
@@ -478,7 +491,7 @@ index 0c2510e..2b4f04c 100644
else:
def _findSoname_ldconfig(name):
@@ -367,6 +417,12 @@ def test():
@@ -370,6 +425,12 @@ def test():
print(f"crypt\t:: {cdll.LoadLibrary(find_library('crypt'))}")
print(f"crypto\t:: {find_library('crypto')}")
print(f"crypto\t:: {cdll.LoadLibrary(find_library('crypto'))}")
@@ -495,14 +508,14 @@ index 0c2510e..2b4f04c 100644
2.42.1
From 90badefb931e909cb4ec993b9b097badcd66e4be Mon Sep 17 00:00:00 2001
From 853be77903433468b699b96170140a7f622d4af8 Mon Sep 17 00:00:00 2001
From: Philipp Wolfer <phil@parolu.io>
Date: Mon, 23 Sep 2019 09:14:58 +0200
Subject: webbrowser: Support for default browsers on Haiku
diff --git a/Lib/webbrowser.py b/Lib/webbrowser.py
index 44974d4..ce78f41 100755
index 5d72524..eb0879f 100755
--- a/Lib/webbrowser.py
+++ b/Lib/webbrowser.py
@@ -549,6 +549,11 @@ def register_standard_browsers():
@@ -521,7 +534,7 @@ index 44974d4..ce78f41 100755
2.42.1
From 7e0b76caa0d03cc8f8761dd9edddd744dd67e300 Mon Sep 17 00:00:00 2001
From 98361e94e8a22d4e287ba44834bf2ef8d778fe88 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 4 Oct 2019 22:02:35 +0200
Subject: since 3.8, don't reinit locks on fork.
@@ -544,7 +557,7 @@ index bcee2ba..46630a4 100644
2.42.1
From 8a3b2053eff0af149b8118045a1e5263479557b6 Mon Sep 17 00:00:00 2001
From 2b6afd77361526bcfbd9d981950e29b7906cc8fb Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Fri, 15 May 2020 15:20:57 +0200
Subject: handle errors returned by internal_connect()
@@ -552,7 +565,7 @@ Subject: handle errors returned by internal_connect()
upstream bug #40628 by Ryan C. Gordon
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 997df43..8b660b4 100644
index f0c9b46..dd9b7da 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -3327,7 +3327,7 @@ sock_connect(PySocketSockObject *s, PyObject *addro)
@@ -577,17 +590,17 @@ index 997df43..8b660b4 100644
2.42.1
From 06bddd0cdf4e2529a6cea35fc126ef5477f37b1c Mon Sep 17 00:00:00 2001
From 30975e468052299321f077b82b3edd524f70db08 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 19 Oct 2020 18:03:09 +0200
Subject: ttyname_r can use MAXPATHLEN
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 9ac021f..c77ba68 100644
index e70fef5..df55963 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3112,11 +3112,14 @@ static PyObject *
@@ -3113,11 +3113,14 @@ static PyObject *
os_ttyname_impl(PyObject *module, int fd)
/*[clinic end generated code: output=c424d2e9d1cd636a input=9ff5a58b08115c55]*/
{
@@ -607,7 +620,7 @@ index 9ac021f..c77ba68 100644
2.42.1
From b5cd57a0b38a76ed5049e8335700df28580b649e Mon Sep 17 00:00:00 2001
From 18c302be98981320722703994ec5969906b5fd1c Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Wed, 5 Oct 2022 16:09:41 -0300
Subject: The rest of korli's "initial Haiku patch".
@@ -648,7 +661,7 @@ index ebe3711..63e2742 100644
# This is done to support downstream modifications where distributors change
# the installation layout (eg. different site-packages directory).
diff --git a/configure.ac b/configure.ac
index 52d5c1f..78567be 100644
index bbe7f89..a42040f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1503,6 +1503,16 @@ if test $enable_shared = "yes"; then
@@ -694,7 +707,7 @@ index 52d5c1f..78567be 100644
# -u libsys_s pulls in all symbols in libsys
Darwin/*)
LINKFORSHARED="$extra_undefs -framework CoreFoundation"
@@ -5352,6 +5363,7 @@ AC_CHECK_FUNC(__fpu_control,
@@ -5353,6 +5364,7 @@ AC_CHECK_FUNC(__fpu_control,
AC_SUBST(LIBM)
case $ac_sys_system in
Darwin) ;;
@@ -703,7 +716,7 @@ index 52d5c1f..78567be 100644
esac
AC_MSG_CHECKING(for --with-libm=STRING)
diff --git a/setup.py b/setup.py
index 4f122b6..dc42f39 100644
index ad8fb81..07fd69f 100644
--- a/setup.py
+++ b/setup.py
@@ -84,6 +84,7 @@ CYGWIN = (HOST_PLATFORM == 'cygwin')
@@ -714,7 +727,7 @@ index 4f122b6..dc42f39 100644
EMSCRIPTEN = HOST_PLATFORM == 'emscripten-wasm32'
CC = os.environ.get("CC")
if not CC:
@@ -890,6 +891,11 @@ class PyBuildExt(build_ext):
@@ -891,6 +892,11 @@ class PyBuildExt(build_ext):
with open(config_h) as file:
self.config_h_vars = sysconfig.parse_config_h(file)
@@ -730,7 +743,7 @@ index 4f122b6..dc42f39 100644
2.42.1
From 9bfff6217e20682d79cbc465a0aecf900ba355f0 Mon Sep 17 00:00:00 2001
From 7ef67128bb5adca7ade61158660cd0c0c0a15bda Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Mon, 24 Oct 2022 20:04:10 -0300
Subject: Lib/test: require the "largefile" usage flag for I/O heavy tests.
@@ -741,7 +754,7 @@ This avoids needing several GBs of storage to run the tests
(unless the "largefile" resource usage flag is enabled).
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 7853705..ffde3a7 100644
index 3dae789..1258c67 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -613,7 +613,7 @@ class IOTest(unittest.TestCase):
@@ -767,10 +780,10 @@ index 3b0930f..c21f001 100644
'test requires %s bytes and a long time to run' % str(size))
else:
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index dfcf303..611d3c8 100644
index 1867e8c..ab52b6a 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -1007,7 +1007,7 @@ class LargeMmapTests(unittest.TestCase):
@@ -1009,7 +1009,7 @@ class LargeMmapTests(unittest.TestCase):
unlink(TESTFN)
def _make_test_file(self, num_zeroes, tail):
@@ -783,7 +796,7 @@ index dfcf303..611d3c8 100644
2.42.1
From 4d17c9efbc6546f643d7f4f2d30c2b9de93dcf2d Mon Sep 17 00:00:00 2001
From 6168fba742823ca3ee1d36cb6201abeb33db74ff Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 7 Mar 2023 18:29:29 +0100
Subject: default schemes for Haiku
@@ -870,7 +883,7 @@ index 63e2742..6ba9d18 100644
2.42.1
From da95612a7296813a2b12c4d82bb8fbd335560072 Mon Sep 17 00:00:00 2001
From 136a1494cf17d93146990f04b5679abaeae9fb31 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Fri, 10 Mar 2023 20:15:14 -0300
Subject: syncronize both _getuserbase() copies on site.py and sysconfig.py.
@@ -898,3 +911,69 @@ index 6ba9d18..c3e8dbc 100644
--
2.42.1
From 5a9d80c3b931b0101523081a548fecfa64b8b0de Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Sat, 10 Feb 2024 06:01:25 -0300
Subject: Fix build on nightlies, following the addition of kqueue.
See HaikuPorts issue #10001.
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index 8210269..5750d2c 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -2588,13 +2588,20 @@ _select_exec(PyObject *m)
#ifdef EVFILT_SIGNAL
PyModule_AddIntConstant(m, "KQ_FILTER_SIGNAL", EVFILT_SIGNAL);
#endif
+#ifdef EVFILT_TIMER
PyModule_AddIntConstant(m, "KQ_FILTER_TIMER", EVFILT_TIMER);
-
+#endif
/* event flags */
PyModule_AddIntConstant(m, "KQ_EV_ADD", EV_ADD);
PyModule_AddIntConstant(m, "KQ_EV_DELETE", EV_DELETE);
+#ifdef EV_ENABLE
PyModule_AddIntConstant(m, "KQ_EV_ENABLE", EV_ENABLE);
+#else
+ PyModule_AddIntConstant(m, "KQ_EV_ENABLE", 0); // "test_kqueue.py" assumes KQ_EV_ENABLE exists
+#endif
+#ifdef EV_DISABLE
PyModule_AddIntConstant(m, "KQ_EV_DISABLE", EV_DISABLE);
+#endif
PyModule_AddIntConstant(m, "KQ_EV_ONESHOT", EV_ONESHOT);
PyModule_AddIntConstant(m, "KQ_EV_CLEAR", EV_CLEAR);
@@ -2627,14 +2634,28 @@ _select_exec(PyObject *m)
/* PROC filter flags */
#ifdef EVFILT_PROC
PyModule_AddIntConstant(m, "KQ_NOTE_EXIT", NOTE_EXIT);
+#ifdef NOTE_FORK
PyModule_AddIntConstant(m, "KQ_NOTE_FORK", NOTE_FORK);
+#endif
+#ifdef NOTE_EXEC
PyModule_AddIntConstant(m, "KQ_NOTE_EXEC", NOTE_EXEC);
+#endif
+#ifdef NOTE_PCTRLMASK
PyModule_AddIntConstant(m, "KQ_NOTE_PCTRLMASK", NOTE_PCTRLMASK);
+#endif
+#ifdef NOTE_PDATAMASK
PyModule_AddIntConstant(m, "KQ_NOTE_PDATAMASK", NOTE_PDATAMASK);
+#endif
+#ifdef NOTE_TRACK
PyModule_AddIntConstant(m, "KQ_NOTE_TRACK", NOTE_TRACK);
+#endif
+#ifdef NOTE_CHILD
PyModule_AddIntConstant(m, "KQ_NOTE_CHILD", NOTE_CHILD);
+#endif
+#ifdef NOTE_TRACKERR
PyModule_AddIntConstant(m, "KQ_NOTE_TRACKERR", NOTE_TRACKERR);
+#endif
#endif
/* NETDEV filter flags */
--
2.42.1

View File

@@ -1,41 +0,0 @@
From f85c391be71e71e7d07d579aef5e059bd3df3fe6 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 3 Feb 2018 11:33:49 +0100
Subject: Fix include paths for secondary x86
This helps python find libraries and dependencies properly (openssl,
etc), so a few more modules are enabled.
It also fixes a crash because python would try to load the gcc2 libroot
even when built with gcc5.
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 2b4f04c..dab556c 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -286,6 +286,7 @@ elif os.name == "posix":
directory = directory.replace('%A',
os.path.dirname(os.path.abspath(sys.argv[0] or os.getcwd())))
+ directory = os.path.join(directory, "x86")
if not os.path.isdir(directory):
continue
diff --git a/setup.py b/setup.py
index dc42f39..1c6db8f 100644
--- a/setup.py
+++ b/setup.py
@@ -894,8 +894,8 @@ class PyBuildExt(build_ext):
# Haiku-specific library locations
if HAIKU:
self.inc_dirs += ['/boot/develop/headers/posix',
- '/boot/system/develop/headers']
- self.lib_dirs += ['/boot/system/develop/lib']
+ '/boot/system/develop/headers/x86']
+ self.lib_dirs += ['/boot/system/develop/lib/x86']
# OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb)
if HOST_PLATFORM in ['osf1', 'unixware7', 'openunix8']:
self.lib_dirs += ['/usr/ccs/lib']
--
2.42.1