[openwrt/openwrt] tools/ninja: fix build with python 3.13+

LEDE Commits lede-commits at lists.infradead.org
Tue May 6 02:15:33 PDT 2025


robimarko pushed a commit to openwrt/openwrt.git, branch openwrt-23.05:
https://git.openwrt.org/b4728c3e5ad95611e3c9b074aadcab017643186f

commit b4728c3e5ad95611e3c9b074aadcab017643186f
Author: Arne Zachlod <arne at nerdkeller.org>
AuthorDate: Thu Apr 24 12:50:03 2025 +0200

    tools/ninja: fix build with python 3.13+
    
    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 at nerdkeller.org>
    Link: https://github.com/openwrt/openwrt/pull/18582
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 tools/ninja/patches/010-fix-python-no-pipes.patch | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

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
index 0000000000..2dd421f72a
--- /dev/null
+++ b/tools/ninja/patches/010-fix-python-no-pipes.patch
@@ -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()




More information about the lede-commits mailing list