jruby-launcher
jruby-launcher copied to clipboard
Launcher does not properly pass through -X properties on Windows
This could be some oddity in how powershell passes arguments through to our launcher:
PS C:\dev\jruby> jruby -Xbacktrace.style=raw -e 1
jruby: warning: unknown property jruby.backtrace
Error opening script file: C:/dev/jruby/.style=raw (The system cannot find the file specified)
The .
is improperly being treated as the end of our argument. PowerShell appears to be splitting incoming arguments at .
. I'm not sure how to fix this in the launcher other than detecting we're on PowerShell and de-mangling those arguments :-(
This is running from a self-built clone, rather than using installer.
As expected, it does work with cmd.exe. So this is specific to PowerShell.
The stop-parsing symbol can be used:
jruby --% -Xbacktrace.style=raw -e 1
Or just quote any arguments which contain a dot (or any other special characters):
jruby "-Xbacktrace.style=raw" -e 1
Quoting the dot should actually be enough, but it looks weird.
@cremno Ahh thank you, that's a neat workaround.
@cremno Do you know what we should be doing differently in the launcher (C++)? It's incredibly inconvenient that PowerShell processes arguments differently than cmd.exe :-(
@headius: I think you can't do much (non-hacky) in this case. The command line is always “mangled” since PowerShell does its job before creating the process and passing it.
PowerShell should be considered for the in-progress rewrite of this launcher.