diff options
| author | Markus Volk <f_l_k@t-online.de> | 2024-11-23 14:09:15 +0100 |
|---|---|---|
| committer | Steve Sakoman <steve@sakoman.com> | 2024-12-02 06:23:20 -0800 |
| commit | e95fcf9f571b57aa5e69f234384a5a615978eb0b (patch) | |
| tree | 789a69a242329a31b97f8fd17d1b9332415b38eb | |
| parent | da95ad49d89cc3992cdf70b2b10fc97be557f5cc (diff) | |
| download | poky-e95fcf9f571b57aa5e69f234384a5a615978eb0b.tar.gz | |
ninja: fix build with python 3.13
python 3.13 removed the pipes module. Thus build fails for host machines that run python 3.13
This commit adds a backport patch to use subprocess module instead
(From OE-Core rev: 1a02cf1997216cb943d8965fe74f971a8cb2f70f)
Signed-off-by: Markus Volk <f_l_k@t-online.de>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
| -rw-r--r-- | meta/recipes-devtools/ninja/ninja/885b4efb41c039789b81f0dc0d67c1ed0faea17c.patch | 62 | ||||
| -rw-r--r-- | meta/recipes-devtools/ninja/ninja_1.10.2.bb | 5 |
2 files changed, 66 insertions, 1 deletions
diff --git a/meta/recipes-devtools/ninja/ninja/885b4efb41c039789b81f0dc0d67c1ed0faea17c.patch b/meta/recipes-devtools/ninja/ninja/885b4efb41c039789b81f0dc0d67c1ed0faea17c.patch new file mode 100644 index 0000000000..b23bedd04b --- /dev/null +++ b/meta/recipes-devtools/ninja/ninja/885b4efb41c039789b81f0dc0d67c1ed0faea17c.patch | |||
| @@ -0,0 +1,62 @@ | |||
| 1 | From 9cf13cd1ecb7ae649394f4133d121a01e191560b Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Byoungchan Lee <byoungchan.lee@gmx.com> | ||
| 3 | Date: Mon, 9 Oct 2023 20:13:20 +0900 | ||
| 4 | Subject: [PATCH 1/2] Replace pipes.quote with shlex.quote in configure.py | ||
| 5 | |||
| 6 | Python 3.12 deprecated the pipes module and it will be removed | ||
| 7 | in Python 3.13. In configure.py, I have replaced the usage of pipes.quote | ||
| 8 | with shlex.quote, which is the exactly same function as pipes.quote. | ||
| 9 | |||
| 10 | For more details, refer to PEP 0594: https://peps.python.org/pep-0594 | ||
| 11 | |||
| 12 | Upstream-Status: Backport [https://github.com/ninja-build/ninja/commit/885b4efb41c039789b81f0dc0d67c1ed0faea17c] | ||
| 13 | |||
| 14 | Signed-off-by: Markus Volk <f_l_k@t-online.de> | ||
| 15 | --- | ||
| 16 | configure.py | 4 ++-- | ||
| 17 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/configure.py b/configure.py | ||
| 20 | index 588250aa8a..c6973cd1a5 100755 | ||
| 21 | --- a/configure.py | ||
| 22 | +++ b/configure.py | ||
| 23 | @@ -21,7 +21,7 @@ | ||
| 24 | |||
| 25 | from optparse import OptionParser | ||
| 26 | import os | ||
| 27 | -import pipes | ||
| 28 | +import shlex | ||
| 29 | import string | ||
| 30 | import subprocess | ||
| 31 | import sys | ||
| 32 | @@ -262,7 +262,7 @@ def _run_command(self, cmdline): | ||
| 33 | env_keys = set(['CXX', 'AR', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS']) | ||
| 34 | configure_env = dict((k, os.environ[k]) for k in os.environ if k in env_keys) | ||
| 35 | if configure_env: | ||
| 36 | - config_str = ' '.join([k + '=' + pipes.quote(configure_env[k]) | ||
| 37 | + config_str = ' '.join([k + '=' + shlex.quote(configure_env[k]) | ||
| 38 | for k in configure_env]) | ||
| 39 | n.variable('configure_env', config_str + '$ ') | ||
| 40 | n.newline() | ||
| 41 | |||
| 42 | From 0a9c9c5f50c60de4a7acfed8aaa048c74cd2f43b Mon Sep 17 00:00:00 2001 | ||
| 43 | From: Byoungchan Lee <byoungchan.lee@gmx.com> | ||
| 44 | Date: Mon, 9 Oct 2023 20:13:50 +0900 | ||
| 45 | Subject: [PATCH 2/2] Remove unused module string in configure.py | ||
| 46 | |||
| 47 | --- | ||
| 48 | configure.py | 1 - | ||
| 49 | 1 file changed, 1 deletion(-) | ||
| 50 | |||
| 51 | diff --git a/configure.py b/configure.py | ||
| 52 | index c6973cd1a5..939153df60 100755 | ||
| 53 | --- a/configure.py | ||
| 54 | +++ b/configure.py | ||
| 55 | @@ -22,7 +22,6 @@ | ||
| 56 | from optparse import OptionParser | ||
| 57 | import os | ||
| 58 | import shlex | ||
| 59 | -import string | ||
| 60 | import subprocess | ||
| 61 | import sys | ||
| 62 | |||
diff --git a/meta/recipes-devtools/ninja/ninja_1.10.2.bb b/meta/recipes-devtools/ninja/ninja_1.10.2.bb index 1509a54c9e..e7b82ed9ec 100644 --- a/meta/recipes-devtools/ninja/ninja_1.10.2.bb +++ b/meta/recipes-devtools/ninja/ninja_1.10.2.bb | |||
| @@ -8,7 +8,10 @@ DEPENDS = "re2c-native ninja-native" | |||
| 8 | 8 | ||
| 9 | SRCREV = "e72d1d581c945c158ed68d9bc48911063022a2c6" | 9 | SRCREV = "e72d1d581c945c158ed68d9bc48911063022a2c6" |
| 10 | 10 | ||
| 11 | SRC_URI = "git://github.com/ninja-build/ninja.git;branch=release;protocol=https" | 11 | SRC_URI = " \ |
| 12 | git://github.com/ninja-build/ninja.git;branch=release;protocol=https \ | ||
| 13 | file://885b4efb41c039789b81f0dc0d67c1ed0faea17c.patch \ | ||
| 14 | " | ||
| 12 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.*)" | 15 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P<pver>.*)" |
| 13 | 16 | ||
| 14 | S = "${WORKDIR}/git" | 17 | S = "${WORKDIR}/git" |
