[squeak-dev] Running Squeak fro ma unix shell script file with #! squeak...

David T. Lewis lewis at mail.msen.com
Sun May 5 21:32:19 UTC 2019


On Sun, May 05, 2019 at 02:06:14PM -0700, tim Rowledge wrote:
> 
> 
> > On 2019-05-05, at 1:51 PM, David T. Lewis <lewis at mail.msen.com> wrote:
> > 
> > On Sun, May 05, 2019 at 12:48:13PM -0700, tim Rowledge wrote:
> >> 
> >> 
> >>> On 2019-05-05, at 7:38 AM, Fabio Niephaus <lists at fniephaus.com> wrote:
> >>> 
> >>> Otherwise, `#!/path/to/vm/squeak /path/to/my.image` should work, right?
> >> 
> >> That's what I thought but it doesn't appear to actually do that. I've been looking at https://en.wikipedia.org/wiki/Shebang_(Unix) to try to understand but so far nothing is doing quite what I anticipated.
> >> Most annoyingly I can't get any sort of debugging output using the usual -x flag. 
> >> 
> > 
> > One part of the current problem is that we have somehow broken the script loader:

And the next issue after that is the code loader, which probably used to be smart
enough to skip over the shebang line in the hello.sq script, but apparently no
longer does so.

> 
> Wait, you've actually got it running squeak and trying to load something? How? It doesn't get as far as Squeak on my Pi.
> 

I'm actually having a hard time dredging this out of deep backing store
from my grey matter, but a couple of things do still work (just in Squeak,
not in the grey matter).

Following the tip from Chris Cunnington, I read the squeak man page. That
covers the idea of the self-executing script, which should work fine once
we fix the deprecation issue and re-teach the script loader to skip over
the first line of a script file that begins with '#!'.

The other thing that still works is taking an image file and prepending
it with 512 characters of gunk before the actual image, in which the first
part of those 512 characters is a shebang line. All of the VMs will try
skipping over the first 512 bytes of an image file if the first few bytes
do not look like a valid image format identifier, which allows you to
treat the image file as both a unix script and a Squeak image file at
the same time.

Both of these start the image, but neither of them can load a script due
to the aforementioned issues.

Dave 


More information about the Squeak-dev mailing list