diff options
author | Paulo Neves <ptsneves@gmail.com> | 2022-06-14 17:10:59 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-06-17 17:57:44 +0100 |
commit | 750f4bfea9cdbb38705ded7836203df7cce352e4 (patch) | |
tree | 166d32e7c125ba9bc0b0aab0fefdf7d4b01b28a7 /meta/recipes-devtools/python | |
parent | cf7d8894545b83f55420fa33f7848e1bfc6754ff (diff) | |
download | poky-750f4bfea9cdbb38705ded7836203df7cce352e4.tar.gz |
python: Avoid shebang overflow on python-config.py
The native path may be too big, leading to shebang
overflow. Just use the #!/usr/bin/env python3.
(From OE-Core rev: 84783dee09e48cb930c7cd27944eaf3f03997237)
Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/python')
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch | 33 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python3_3.10.4.bb | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch new file mode 100644 index 0000000000..921da8de7c --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From f0c9dec63d452a7cd1e15ea653f4aced281f021c Mon Sep 17 00:00:00 2001 | ||
2 | From: Paulo Neves <ptsneves@gmail.com> | ||
3 | Date: Tue, 7 Jun 2022 16:16:41 +0200 | ||
4 | Subject: [PATCH 1/1] Avoid shebang overflow on python-config.py | ||
5 | |||
6 | The whole native path may be too big, leading to shebang | ||
7 | overflow. Let's just use the env shebang. | ||
8 | |||
9 | Denial reason: [1] | ||
10 | |||
11 | Upstream-Status: Denied [distribution] | ||
12 | |||
13 | [1] https://github.com/python/cpython/pull/93760#pullrequestreview-1005365737 | ||
14 | --- | ||
15 | Makefile.pre.in | 2 ++ | ||
16 | 1 file changed, 2 insertions(+) | ||
17 | |||
18 | diff --git a/Makefile.pre.in b/Makefile.pre.in | ||
19 | index f0aedb76cb58999427804255da56fa53284d7032..dd88e43114730f7681715777cc76dabb31113176 100644 | ||
20 | --- a/Makefile.pre.in | ||
21 | +++ b/Makefile.pre.in | ||
22 | @@ -1638,6 +1638,8 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh | ||
23 | @ # Substitution happens here, as the completely-expanded BINDIR | ||
24 | @ # is not available in configure | ||
25 | sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py | ||
26 | + @ # Otherwise we might get huge shebangs with native paths | ||
27 | + sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' python-config.py | ||
28 | @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR} | ||
29 | LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config | ||
30 | @ # In OpenEmbedded, always use the python version of the script, the shell | ||
31 | -- | ||
32 | 2.25.1 | ||
33 | |||
diff --git a/meta/recipes-devtools/python/python3_3.10.4.bb b/meta/recipes-devtools/python/python3_3.10.4.bb index 6bd3a6aba8..357025f856 100644 --- a/meta/recipes-devtools/python/python3_3.10.4.bb +++ b/meta/recipes-devtools/python/python3_3.10.4.bb | |||
@@ -34,6 +34,7 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ | |||
34 | file://0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch \ | 34 | file://0001-Lib-pty.py-handle-stdin-I-O-errors-same-way-as-maste.patch \ |
35 | file://0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch \ | 35 | file://0001-setup.py-Do-not-detect-multiarch-paths-when-cross-co.patch \ |
36 | file://deterministic_imports.patch \ | 36 | file://deterministic_imports.patch \ |
37 | file://0001-Avoid-shebang-overflow-on-python-config.py.patch \ | ||
37 | " | 38 | " |
38 | 39 | ||
39 | SRC_URI:append:class-native = " \ | 40 | SRC_URI:append:class-native = " \ |