Skip to content

Commit

Permalink
Fix #1059: Linking for mingw/x86_64 on MSYS2 fails, and optimize "ar"…
Browse files Browse the repository at this point in the history
… command execution

Command line length=8158 is the maximum to be OK.
  • Loading branch information
feiyunw committed Apr 4, 2023
1 parent fb06503 commit 64a818c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tools/my_spawn.py
Original file line number Diff line number Diff line change
Expand Up @@ -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), ")")
Expand All @@ -30,7 +29,7 @@ def mySpawn(sh, escape, cmd, args, 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)
Expand Down

0 comments on commit 64a818c

Please sign in to comment.