You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I first noticed this issue in 2017.11 (MoarVM 2017.11). Git bisect showed that the problem was introduced by commit 40dd369.
To reproduce, run the following in rakudo on Windows (assuming you have perl installed and in the path):
shell 'perl -e "require v5.12;"'
Expected output: no output, a Proc with exitcode => 0. Actual output:
Can't find string terminator '"' anywhere before EOF at -e line 1.
and a Proc with exitcode => 255.
Other commands also silently fail, like qx/python -c "print(4)"/. Commands with no quoting such as shell('echo 4') succeed.
All of the above work as expected before commit 40dd369.
The text was updated successfully, but these errors were encountered:
I think rakudo should not quote/escape/modify of the argument in shell($cmd). The whole point of that function is to let the shell do all the parsing. The alternative is to take the string, parse it into separate arguments (hoping we obey the same rules as the system shell), then re-package those arguments in a format the system shell can understand. That approach has one advantage[1], but it's feature creep. CMD takes one argument, and so does shell. Passing it through unchanged is the obvious answer.
1: It is annoying that quotes used in the shell call will be platform-dependent. perl -e '' will be invalid on Windows, but perl -e "" will be valid on most common shells. However, that's not rakudo's problem--just like you can't call shell("ls") on Windows, you can't call a command with incorrect quoting.
I first noticed this issue in 2017.11 (MoarVM 2017.11). Git bisect showed that the problem was introduced by commit 40dd369.
To reproduce, run the following in rakudo on Windows (assuming you have perl installed and in the path):
shell 'perl -e "require v5.12;"'
Expected output: no output, a
Procwithexitcode => 0. Actual output:Can't find string terminator '"' anywhere before EOF at -e line 1.
and a
Procwithexitcode => 255.Other commands also silently fail, like
qx/python -c "print(4)"/. Commands with no quoting such asshell('echo 4')succeed.All of the above work as expected before commit 40dd369.
The text was updated successfully, but these errors were encountered: