]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
tools/ninja: fix build with python 3.13+ 18582/head
authorArne Zachlod <arne@nerdkeller.org>
Thu, 24 Apr 2025 10:50:03 +0000 (12:50 +0200)
committerRobert Marko <robimarko@gmail.com>
Tue, 6 May 2025 09:15:29 +0000 (11:15 +0200)
python 3.13 removed the pipes module. Replace pipes by shlex. shlex was introduced into python in 3.3

Signed-off-by: Arne Zachlod <arne@nerdkeller.org>
Link: https://github.com/openwrt/openwrt/pull/18582
Signed-off-by: Robert Marko <robimarko@gmail.com>
tools/ninja/patches/010-fix-python-no-pipes.patch [new file with mode: 0644]

diff --git a/tools/ninja/patches/010-fix-python-no-pipes.patch b/tools/ninja/patches/010-fix-python-no-pipes.patch
new file mode 100644 (file)
index 0000000..2dd421f
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/configure.py
++++ b/configure.py
+@@ -23,7 +23,7 @@ from __future__ import print_function
+ from optparse import OptionParser
+ import os
+-import pipes
++import shlex
+ import string
+ import subprocess
+ import sys
+@@ -264,7 +264,7 @@ n.variable('configure_args', ' '.join(co
+ env_keys = set(['CXX', 'AR', 'CFLAGS', 'CXXFLAGS', 'LDFLAGS'])
+ configure_env = dict((k, os.environ[k]) for k in os.environ if k in env_keys)
+ if configure_env:
+-    config_str = ' '.join([k + '=' + pipes.quote(configure_env[k])
++    config_str = ' '.join([k + '=' + shlex.quote(configure_env[k])
+                            for k in configure_env])
+     n.variable('configure_env', config_str + '$ ')
+ n.newline()