Spring.Restart and Linux

Spring.Restart and Linux

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Spring.Restart and Linux

Post by zwzsg »

As I understood it, the Lua command Spring.Restart takes two arguments:
- First argument is a string with all the commandline arguments
- Second argument is a string with all the content of a startscript

But! Passing a startscript filename as a commandline argument makes Spring uses it!

So there are two ways to use Spring.Restart
  • With a string containing a script filename as first argument, and "" as second argument.
  • With a dummy commandline argument such as "-s" as first argument and a startscript content as second argument
From second-hand accounts I get from Linux people, it appears the second way does not work in Linux's Spring.

For testing:
  • Kernel_Panic_4.4.sd7: a version of Kernel Panic where my single player widget use something akin to Spring.Restart("-s",VFS.LoadFile("MyStartScript.txt"))
  • Kernel_Panic_4.4TL1.sd7: a version of Kernel Panic where my single player widget use something akin to Spring.Restart("MyStartScript.txt","")
As a Linux user:
Can you test my single player menu of each of this two KP version, and tell me if it works in, both, none, or either?
Note: To test my single player menu, play alone, press esc to bring up the menu, then click "skirmish" and "run". Ideally it should close Spring and reopen a new Spring instance with random skirmish game.


As dev:
Can you tell me if I understood right the usage of Spring.Restart, and why does my widget doesn't work for so many Linux people, is it a bug in Linux implementation of Spring.Restart, or am I using Spring.Restart wrongly?
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: Spring.Restart and Linux

Post by abma »

looks like double-quotes for me:

open("\"/home/abma/.spring/script.txt\"", O_RDONLY) = -1 ENOENT (No such file or directory)

(thats the non-tl version)

fixed in next release: https://github.com/spring/spring/commit ... 0d3e0cf403
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Spring.Restart and Linux

Post by zwzsg »

Thank you!
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Spring.Restart and Linux

Post by knorke »

Spring.Restart appearently fails on Mac too.
eg here:
http://springrts.com/phpbb/viewtopic.ph ... c&start=47
Posts are a bit older..thought i had made a mantis but seems not so.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: Spring.Restart and Linux

Post by zwzsg »

Spring Tank uses:
local file=VFS.LoadFile(startscriptfilename)
Spring.Restart("-s", file)

I heard MacOS Spring build are derived from Linux build.

So this is indeed looks like the same bug.
Post Reply

Return to “Help & Bugs”