From 64a818cfd9a30509f5d25110e33f2883cdd2e96a Mon Sep 17 00:00:00 2001 From: Feiyun Wang Date: Tue, 4 Apr 2023 19:54:14 +0800 Subject: [PATCH] Fix #1059: Linking for mingw/x86_64 on MSYS2 fails, and optimize "ar" command execution Command line length=8158 is the maximum to be OK. --- tools/my_spawn.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/my_spawn.py b/tools/my_spawn.py index 13ca0a69..42c9448c 100644 --- a/tools/my_spawn.py +++ b/tools/my_spawn.py @@ -12,8 +12,7 @@ def configure(env): def mySubProcess(cmdline, env): # print(cmdline) - proc = subprocess.run(args=cmdline, shell=True, env=env) - rv = proc.returncode + rv = subprocess.run(args=cmdline, shell=True, env=env).returncode if rv: print("=====") print("subprocess.run().returncode=", rv, "(", hex(rv), ")") @@ -30,7 +29,7 @@ def configure(env): length = lead + 1 + len(args[begin]) for i in range(4, len(args)): length += 1 + len(args[i]) - if length > 8153: + if length > 8158: cmdline = " ".join(args[0:3] + args[begin:i]) # print("objs=", i - begin, ", length=", len(cmdline)) rv = mySubProcess(cmdline, env)