OpenSmalltalk / opensmalltalk-vm

Cross-platform virtual machine for Squeak, Pharo, Cuis, and Newspeak.
http://opensmalltalk.org/
Other
547 stars 110 forks source link

Win32 commandline Squeak start-up script ignored #655

Closed alandao closed 1 year ago

alandao commented 1 year ago

I'm trying to run a Smalltalk script on VM start-up on Windows. It looks like GNU/Linux is able to do it with this command: ../cogspur/squeak Cuis5.0-4426 -s ../scripts/setUpEnvironment.st

However, the start-up script is ignored when I try this equivalent command on Windows: cogspur\Squeak.exe Cuis5.0-4426.image -s ../scripts/setUpEnvironment.st

Is there a Windows equivalent way to run a script on VM start-up?

OpenSmalltalk-Bot commented 1 year ago

On 2022-09-30, at 11:01 PM, Alan Dao @.***> wrote:

I'm trying to run a Smalltalk script on VM start-up on Windows. It looks like GNU/Linux is able to do it with this command: ../cogspur/squeak Cuis5.0-4426 -s ../scripts/setUpEnvironment.st

Hmph, that's not how I'd expect to run it; normally I just add the script name after the image name. It's been that way forever.

However, the start-up script is ignored when I try this equivalent command on Windows: cogspur\Squeak.exe Cuis5.0-4426.image -s ../scripts/setUpEnvironment.st

Is there a Windows equivalent way to run a script on VM start-up?

I don't do windows but maybe just try without the -s ?

tim

tim Rowledge; @.***; http://www.rowledge.org/tim Useful random insult:- Looks for the "Any" key.

alandao commented 1 year ago

I’ve also tried without the -s flag and it didn’t work either :(

krono commented 1 year ago

So you used cogspur\Squeak.exe Cuis5.0-4426.image -s ../scripts/setUpEnvironment.st on Windows. I don't know where path normalization kicks in, but what about cogspur\Squeak.exe Cuis5.0-4426.image -s ..\scripts\setUpEnvironment.st?

Also, in the past, the script sometimes needed to be an absolute path, maybe try that too?

eliotmiranda commented 1 year ago

You must use SqueakConsole.exe; Windows is badly broken like that. Command line arguments are not passed along for Squeak.exe.

When the system is running you can check that the arguments are available via getSystemAttribute: and senders (eg Squeak has SmalltalkImage>>rawArguments and SmalltalkImage>>arguments; not sure what Cuis provides).

OpenSmalltalk-Bot commented 1 year ago

I had to try that VM a while back, hoping to get a headless server system runnng and it still insisted on opening a window. Very annoying.

On 2022-10-03, at 6:33 AM, Eliot Miranda @.***> wrote:

You must use SqueakConsole.exe; Windows is badly broken like that. Command line arguments are not passed along for Squeak.exe.

When the system is running you can check that the arguments are available via getSystemAttribute: and senders (eg Squeak has SmalltalkImage>>rawArguments and SmalltalkImage>>arguments; not sure what Cuis provides).

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

tim

tim Rowledge; @.**; http://www.rowledge.org/tim "How many Motie Mediators does it take to chage a lightbulb?” "Are you insane? Only Crazy Eddie would want to change anything*!"

OpenSmalltalk-Bot commented 1 year ago

There was a bit of discussion relating to thing in the main squeak-dev mailing list back in July, subject line "headful evaluation of script, supplied on the command line, with Squeak 6" It's faintly possible some of that might help you.

On 2022-10-02, at 11:21 PM, Alan Dao @.***> wrote:

I’ve also tried without the -s flag and it didn’t work either :(

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

tim

tim Rowledge; @.***; http://www.rowledge.org/tim Useful random insult:- During evolution his ancestors were in the control group.

alandao commented 1 year ago

You must use SqueakConsole.exe; Windows is badly broken like that. Command line arguments are not passed along for Squeak.exe.

When the system is running you can check that the arguments are available via getSystemAttribute: and senders (eg Squeak has SmalltalkImage>>rawArguments and SmalltalkImage>>arguments; not sure what Cuis provides).

So, I checked the available system attributes w/ getSystemAttribute: in Cuis and saw that all my Windows command line args are passed into the image as system attributes properly on SqueakConsole.exe and Squeak.exe. After I did a few changes to my Cuis image, I was able to get my start-up script running! I'm confident the issue here is actually related to the Cuis image and has nothing to do with OpenSmalltalk. I'll go ahead and close this issue and let the Cuis maintainers know.

Thanks for the help!

alandao commented 1 year ago

I’ve also tried without the -s and it didn’t work either :(

On Sun, Oct 2, 2022 at 10:07 OpenSmalltalk-Bot @.***> wrote:

On 2022-09-30, at 11:01 PM, Alan Dao @.***> wrote:

I'm trying to run a Smalltalk script on VM start-up on Windows. It looks like GNU/Linux is able to do it with this command: ../cogspur/squeak Cuis5.0-4426 -s ../scripts/setUpEnvironment.st

Hmph, that's not how I'd expect to run it; normally I just add the script name after the image name. It's been that way forever.

However, the start-up script is ignored when I try this equivalent command on Windows: cogspur\Squeak.exe Cuis5.0-4426.image -s ../scripts/setUpEnvironment.st

Is there a Windows equivalent way to run a script on VM start-up?

I don't do windows but maybe just try without the -s ?

tim

tim Rowledge; @.***; http://www.rowledge.org/tim Useful random insult:- Looks for the "Any" key.

— Reply to this email directly, view it on GitHub https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/655#issuecomment-1264689657, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGVFKANS2OA23E3GHR6MDLWBG6NPANCNFSM6AAAAAAQ2JVNFQ . You are receiving this because you authored the thread.Message ID: @.***>