Repository navigation
fix(run): quote each argument of a multi-argument command - #622
not-matthias merged 1 commit into
Conversation
Joining argv with spaces and running the result through a shell made `codspeed run -- cargo codspeed run 'a|b'` pipe into a command named `b`. Quote each argument when more than one is given. A single argument is still raw shell, so `codspeed run -- "cmd1 && cmd2"` is unchanged.
[Medium impact] The PR appears safe to merge with the stated compatibility change. Summary
Reviews (2) · Last reviewed commit: "fix(run): quote each argument of a multi..." · Reviewed by Greptile |
Merging this PR will not alter performance2 warnings
Comparing Footnotes
|
Fixes COD-4230
Problem
codspeed runjoinedargs.commandwith spaces and ran the result through a shell. Quoting removed by the user's shell was lost, socodspeed run -- cargo codspeed run 'a|b'rancargo codspeed run a|b, piping into a command namedb.Change
codspeed run -- "cmd1 && cmd2"behaves as before.shell_words::join, so the command runs exactly as the user's shell parsed it.codspeed execis not affected: it passes argv to exec-harness as structured JSON, and itsjoin(" ")only builds a log label.Compatibility
Breaks callers who split shell syntax across several arguments, e.g.
codspeed run -- cargo bench '&&' echo done. Those should pass one quoted string instead.Tests
Unit tests cover single-string passthrough and quoting of plain args,
|,&&, spaces,$and single quotes.