-
Notifications
You must be signed in to change notification settings - Fork 13
Fix: Linux CI failing due to too many arguments in ar command #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
db53da2
c18312f
fef86c2
2e6daa0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,49 @@ def exists(env): | |
| return True | ||
|
|
||
|
|
||
| def configure(env): | ||
| import subprocess | ||
|
|
||
| def mySubProcess(cmdline, env): | ||
| import shlex | ||
|
|
||
| kwargs = {} | ||
| args = shlex.split(cmdline) | ||
|
|
||
| proc = subprocess.Popen( | ||
| args, | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| stdin=subprocess.PIPE, | ||
| shell=False, | ||
| env=env, | ||
| **kwargs, | ||
| ) | ||
| rv = proc.wait() | ||
| return rv | ||
|
|
||
| def mySpawn(sh, escape, cmd, args, env): | ||
| rv = 0 | ||
| if len(args) > 512 and cmd.endswith("ar"): | ||
| cmdline = cmd + " " + args[1] + " " + args[2] + " " | ||
| for i in range(3, len(args), 510): | ||
| batch = args[i : i + 510] | ||
| line = cmdline + " ".join(batch) | ||
| print(line) | ||
| rv = mySubProcess(line, env) | ||
| if rv: | ||
| break | ||
| else: | ||
| newargs = " ".join(args[1:]) | ||
| cmdline = cmd + " " + newargs | ||
| if cmd.endswith("ar"): | ||
| print(cmdline) | ||
| rv = mySubProcess(cmdline, env) | ||
|
|
||
| return rv | ||
|
|
||
| env["SPAWN"] = mySpawn | ||
| env.Replace(ARFLAGS=["q"]) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: fd -t f "linux.py" --path "*/tools/*"Repository: Redot-Engine/redot-cpp Length of output: 300 🏁 Script executed: cat -n tools/linux.py | head -80Repository: Redot-Engine/redot-cpp Length of output: 2998 🏁 Script executed: rg -i "batch.*ar|ar.*batch" tools/linux.py -B 2 -A 2Repository: Redot-Engine/redot-cpp Length of output: 308 🏁 Script executed: wc -l tools/linux.pyRepository: Redot-Engine/redot-cpp Length of output: 85 🏁 Script executed: cat -n tools/linux.pyRepository: Redot-Engine/redot-cpp Length of output: 3805 🏁 Script executed: rg "use_llvm" tools/linux.py -B 3 -A 3Repository: Redot-Engine/redot-cpp Length of output: 447 🏁 Script executed: rg "ARFLAGS|ar\.command|\bAR\b" tools/linux.py -B 2 -A 2Repository: Redot-Engine/redot-cpp Length of output: 127 🏁 Script executed: git log --oneline tools/linux.py | head -20Repository: Redot-Engine/redot-cpp Length of output: 136 🏁 Script executed: git diff HEAD~5 tools/linux.pyRepository: Redot-Engine/redot-cpp Length of output: 255 🏁 Script executed: fd -t f "\.py$" tools/ | xargs rg -l "batch.*ar|ar.*batch" 2>/dev/nullRepository: Redot-Engine/redot-cpp Length of output: 81 🏁 Script executed: rg -i "batch.*ar|ar.*batch|archived.*batch" --type pyRepository: Redot-Engine/redot-cpp Length of output: 123 🏁 Script executed: rg "ar\.command|ARFLAGS" --type py -B 3 -A 3Repository: Redot-Engine/redot-cpp Length of output: 906 🏁 Script executed: find . -name "*.gn" -o -name "*.gni" | head -20Repository: Redot-Engine/redot-cpp Length of output: 48 🏁 Script executed: rg "ARFLAGS|ar_command|ar\.command" --type gn --type gni -B 2 -A 2 2>/dev/null | head -50Repository: Redot-Engine/redot-cpp Length of output: 48 🏁 Script executed: rg -i "batch" --type gn | head -20Repository: Redot-Engine/redot-cpp Length of output: 215 🏁 Script executed: cat tools/linux.pyRepository: Redot-Engine/redot-cpp Length of output: 3105 🌐 Web query:
💡 Result: In GNU ar, the q (quick append) flag is designed to add files to the end of an archive without checking for existing members with the same name [1][2][3]. Because it skips this check, it is faster than the r (replace) operation [1][4]. Key behaviors of the q flag include: 1. No Replacement: It does not replace existing members; it simply appends new files to the end of the archive [1][2]. 2. Placement: Modifiers such as a, b, or i, which are used to specify the position of new members, do not affect the q operation; new members are always placed at the end [1][3]. 3. Symbol Table: Historically, q did not update the archive's symbol table index to maintain speed [1][2]. However, because many systems expect the index to be current, GNU ar will rebuild the symbol table even when using q [2]. 4. Compatibility Note: GNU ar treats the command qs as a synonym for r, meaning it will replace existing files and append new ones [2][4][3]. 5. Incompatibility with u: The u (update) modifier, which only inserts files newer than those already in the archive, is not allowed with q because checking timestamps would negate the speed advantage of the quick append operation [1][4][3]. Citations:
🌐 Web query:
💡 Result: The q (quick append) flag in llvm-ar is used to append files to the end of an archive without checking for or removing duplicates [1][2]. Because it does not perform any deduplication, it is generally faster than the r (replace) operation, which must scan the archive to identify and replace existing members with the same name [1][2]. If the specified archive does not exist, llvm-ar will create it [1][2]. Citations:
🏁 Script executed: rg "use_llvm|ARFLAGS" tools/ -B 5 -A 5Repository: Redot-Engine/redot-cpp Length of output: 7173 Fix global ARFLAGS setting. The 🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| def generate(env): | ||
| if env["use_llvm"]: | ||
| clang.generate(env) | ||
|
|
@@ -49,3 +92,5 @@ def generate(env): | |
| env["lto"] = "full" | ||
|
|
||
| common_compiler_flags.generate(env) | ||
|
|
||
| configure(env) | ||
Uh oh!
There was an error while loading. Please reload this page.