-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Quoting on windows with jruby-launcher gets bungled when launching 64bit JVM #3725
Comments
…quoting in jruby-launcher (JRUBY #3725)
Does the C++ JRuby-launcher affect how JRuby executes commands on Windows via Kernel#system by any chance? Here an example (command prompt session) on Windows where JRuby is removing double quotes from strings before executing them through Kernel#system (which deviates from the behavior on CRuby):
|
@preetpalS No but on windows we fall back from a native posix-based launch in some cases (system might be one) to a pure-Java solution. I believe we try and parse quotes and are probably doing it wrong? I think that would be a reasonable new issue to open. |
I don't think the problem really lies in JRuby. Rather, the arguments the outermost process gets from the shell (cmd.exe in this case) have already had their quotes stripped, as per console quoting rules. So we can't really tell what the original argument string was. The best solution for this would be to finally ship both a 32-bit and 64-bit executable and have people install the one that corresponds to their JVM install. We have talked about doing this but I doubt it can make 1.7.27 or potentially any other 1.7.x release (ping @enebo). |
A discovery: we may be able to use win32 function GetCommandLine to get the original unadulterated command line. Given that we should be able to pass it along to the child process accurately...I hope! |
It appers that GetCommandLine does what it says: it returns the original command line without any shell-processing. However there's a new wrinkle: if there are It still seems to me that the best option would be to ship both 32 and 64-bit binaries and have some install process (or user step) copy the right one to jruby.exe. |
Environment
Windows when running 64 bit JVM. Using jruby-launcher (pre-mjruby merge) which is committed as an .exe in our repo. both 9.0.4.0 and 1.7.24 have this problem.
Expected Behavior
should output 'foo'.
Actual Behavior
Complains about no symbol foo. This is because if you run the launcher which is compiled for 32 bits will have to fall back to a full CLI launch on 64 bit JVMs. The parsing of the command-line ends up passing args as:
so the puts and the empty space after foo are strings and foo is just a bareword.
The actual resolution to this bug will be to merge mjruby into jruby-launcher (issue?) and then we will no longer be using C++ jruby-launcher code on windows.
The text was updated successfully, but these errors were encountered: