pharo-project / pharo-vm

This is the VM used by Pharo
http://pharo.org
Other
113 stars 70 forks source link

Commandline munging puts --interactive in wrong location #123

Open bencoman opened 3 years ago

bencoman commented 3 years ago

When the VM munges the commandline to insert the --interactive flag, it is simply appending it which interferes in-Image CommandLineHandl-ing

With shell-only WSL Ubuntu... ./pharo Pharo.image eval 1 + 2 produces expected output...

3

From Windows 10 cmd.exe... pharoconsole.exe --headless Pharo9.0-SNAPSHOT-64bit-099690e.image eval 1 + 2 works okay...

3

but... pharoconsole.exe Pharo9.0-SNAPSHOT-64bit-099690e.image eval 1 + 2 produces error...

SmallInteger(Object)>>doesNotUnderstand: #'--' image with the GUI opening to show an erroneous "--interactive" has been appended to the command line.

VM info:

> pharoconsole.exe Pharo9.0-SNAPSHOT-64bit-099690e.image --version
Image: Pharo-9.0.0+build.839.sha.099690e06c28b1d6836db93c8e724a7044c69844 (64 Bit)[
VM:    CoInterpreterWithQueueFFI VMMaker-tonel.1 uuid: be795315-f06d-0d00-aab5-813a0e395221 Oct 13 2020
StackToRegisterMappingCogit VMMaker-tonel.1 uuid: be795315-f06d-0d00-aab5-813a0e395221 Oct 13 2020
e829a1da - Commit: e829a1da - Date: 2020-10-13 15:43:09 +0200

There seem three options:

  1. The "--interactive" flag needs to be inserted after the executable rather than appended to the arguments
  2. The in-image CommandLineHandler needs to be able to handle executable appended flags at end of commandline
  3. VM passes its determination of headless/interactive status to the Image viaVirtualMachine>>getSystemAttribute: so that it doesn't need to munge the commandline at all.
VincentBlondeau commented 3 years ago

Fixed. Can be closed