diff options
Diffstat (limited to 'poky/meta/recipes-devtools/python/python3')
3 files changed, 83 insertions, 3 deletions
diff --git a/poky/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch b/poky/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch new file mode 100644 index 0000000000..921da8de7c --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch @@ -0,0 +1,33 @@ +From f0c9dec63d452a7cd1e15ea653f4aced281f021c Mon Sep 17 00:00:00 2001 +From: Paulo Neves <ptsneves@gmail.com> +Date: Tue, 7 Jun 2022 16:16:41 +0200 +Subject: [PATCH 1/1] Avoid shebang overflow on python-config.py + +The whole native path may be too big, leading to shebang +overflow. Let's just use the env shebang. + +Denial reason: [1] + +Upstream-Status: Denied [distribution] + +[1] https://github.com/python/cpython/pull/93760#pullrequestreview-1005365737 +--- + Makefile.pre.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/Makefile.pre.in b/Makefile.pre.in +index f0aedb76cb58999427804255da56fa53284d7032..dd88e43114730f7681715777cc76dabb31113176 100644 +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -1638,6 +1638,8 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh + @ # Substitution happens here, as the completely-expanded BINDIR + @ # is not available in configure + sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py ++ @ # Otherwise we might get huge shebangs with native paths ++ sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' python-config.py + @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR} + LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config + @ # In OpenEmbedded, always use the python version of the script, the shell +-- +2.25.1 + diff --git a/poky/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch b/poky/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch index 5485020eb4..62dce4b827 100644 --- a/poky/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch +++ b/poky/meta/recipes-devtools/python/python3/0001-Don-t-search-system-for-headers-libraries.patch @@ -1,4 +1,4 @@ -From b6ead2d17ceafed47e598b6f50f3ff669deec5ab Mon Sep 17 00:00:00 2001 +From c83256e40d3057ac6325d649f9ce4c4da2c00874 Mon Sep 17 00:00:00 2001 From: Jeremy Puhlman <jpuhlman@mvista.com> Date: Wed, 4 Mar 2020 00:06:42 +0000 Subject: [PATCH] Don't search system for headers/libraries @@ -11,10 +11,10 @@ Signed-off-by: Jeremy Puhlman <jpuhlman@mvista.com> 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py -index c190002..5ef368d 100644 +index f7a3d39..9d2273d 100644 --- a/setup.py +++ b/setup.py -@@ -854,8 +854,8 @@ class PyBuildExt(build_ext): +@@ -857,8 +857,8 @@ class PyBuildExt(build_ext): add_dir_to_list(self.compiler.include_dirs, sysconfig.get_config_var("INCLUDEDIR")) diff --git a/poky/meta/recipes-devtools/python/python3/0001-Mitigate-the-race-condition-in-testSockName.patch b/poky/meta/recipes-devtools/python/python3/0001-Mitigate-the-race-condition-in-testSockName.patch new file mode 100644 index 0000000000..e19df08f87 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3/0001-Mitigate-the-race-condition-in-testSockName.patch @@ -0,0 +1,47 @@ +Upstream-Status: Pending +Signed-off-by: Ross Burton <ross.burton@arm.com> + +From 8103b90148e8768456c3ab707de105d63d9d5b20 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@arm.com> +Date: Fri, 17 Jun 2022 11:53:59 +0100 +Subject: [PATCH] Mitigate the race condition in testSockName + +find_unused_port() has an inherent race condition, but we can't use +bind_port() as that uses .getsockname() which this test is exercising. + +Try binding to unused ports a few times before failing. +--- + Lib/test/test_socket.py | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py +index c981903824..b1630d18b6 100644 +--- a/Lib/test/test_socket.py ++++ b/Lib/test/test_socket.py +@@ -1390,10 +1390,21 @@ def testStringToIPv6(self): + + def testSockName(self): + # Testing getsockname() +- port = socket_helper.find_unused_port() + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + self.addCleanup(sock.close) +- sock.bind(("0.0.0.0", port)) ++ ++ # Since find_unused_port() is inherently subject to race conditions, we ++ # call it a couple times if necessary. ++ for i in itertools.count(): ++ port = socket_helper.find_unused_port() ++ try: ++ sock.bind(("0.0.0.0", port)) ++ except OSError as e: ++ if e.errno != errno.EADDRINUSE or i == 5: ++ raise ++ else: ++ break ++ + name = sock.getsockname() + # XXX(nnorwitz): http://tinyurl.com/os5jz seems to indicate + # it reasonable to get the host's addr in addition to 0.0.0.0. +-- +2.25.1 + |