[Newbies] Running Squeak in a Unix shell
Christoph.Thiede at student.hpi.uni-potsdam.de
Tue Oct 29 12:11:32 UTC 2019
thank you very much!
The `file` command gave me the hint that I was trying to run a 32-bit squeak on a 64-bit system. Now it works!
Von: Beginners <beginners-bounces at lists.squeakfoundation.org> im Auftrag von David T. Lewis <lewis at mail.msen.com>
Gesendet: Dienstag, 29. Oktober 2019 12:56:20
An: A friendly place to get answers to even the most basic questions about Squeak.
Betreff: Re: [Newbies] Running Squeak in a Unix shell
On Tue, Oct 29, 2019 at 08:27:50AM +0000, Thiede, Christoph wrote:
> Hi Dave,
> thank you for the detailed answer!
> Actually, WSL is emulating a real unix system and it uses bash, so things like `cowsay Hello world` work indeed.
> Is it possible that squeak does not support unix in general, but only certain distributions? It would be very nice to use it from WSL, which is becoming more important on Windows compared to the classic cmd.exe.
The Unix VM for Squeak is portable across a wide range of Unix and
Unix-like systems. But "portable" means different things to different
people. In your case, I think you'll just need to dig into it to find
out what that error message is telling you.
I can't guess the exact problem, but I am certain that the error message
(squeak: cannot execute binary file: Exec format error) will lead you
to it. It might be the "squeak" shell script, or it might be the
compiled binary VM (probably also called "squeak"), or it might be
something about how it is installed, I don't know. But one way or
another, WSL is trying to tell you that it does not know how to execute
one of those files.
A command that may be helpful for you to track this down is the Unix
"file" command (for example, "file squeak"). If the file you are testing
with this command is an executable file (such as the compiled VM), the
"file" command will explain what it is. If the "file" command cannot
figure out what the file is, then it probably is not a file that WSL
> Regarding Travis: I found a few scripts such as https://github.com/hpi-swa/vivide/blob/master/scripts/prepare_image.sh#L64 that are calling Smalltalk as well. Why does that work, I would not assume that each Travis execution environment comes with a display driver, does it?
I don't know, but I would assume the opposiste, that the Travis execution
environment probably does not come with a display driver.
> @Nicola Maybe you will want to have a look at CommandLineToolSet?
> Von: Beginners <beginners-bounces at lists.squeakfoundation.org> im Auftrag von David T. Lewis <lewis at mail.msen.com>
> Gesendet: Mittwoch, 23. Oktober 2019 03:11:16
> An: A friendly place to get answers to even the most basic questions about Squeak.
> Betreff: Re: [Newbies] Running Squeak in a Unix shell
> Hi Christoph,
> On Tue, Oct 22, 2019 at 10:41:16PM +0000, Thiede, Christoph wrote:
> > Hi,
> > this a question by a shell noob: How can I use Squeak in a unix shell to run a command such as:
> > ./squeak foo.image bar.st
> > I would like to do this in my WSL shell (Windows Subsystem for Linux) as well as on Travis.
> > WSL says:
> > squeak: cannot execute binary file: Exec format error
> The command line that you gave ("./squeak foo.image bar.st") would be
> appropriate on a Unix system (Linux, OS X, or whatever) if you have
> a file called "squeak" in your current directory, and if that file
> is an executable file such as a shell script or a compiled executable.
> I am not familiar with WSL, but assuming that it is trying to behave
> like a Unix shell, I would interpret the error message as follows:
> - The shell tried to execute the file "./squeak", where the "./"
> portion of the file path means "in the current directory", and "squeak"
> is the name of the file to be executed.
> - It found the file, and tried to open it. You did not see a "file
> not found" error, so there actually must be a file called "squeak" in
> your local directory, and the file has execute permissions, so all
> good so far.
> - The shell then tried to execute the "squeak" program. This means
> that the shell saw that the file was marked executable, and it asked
> the operating system to "exec" the file (on a Unix system, this will
> fork the shell process and overlay the executable in the new process,
> see http://man7.org/linux/man-pages/man3/exec.3.html).
> - For some reason, the file could not be executed ("Exec format error").
> This suggest to me that the WSL environment did not know how to
> execute the "squeak" file. Maybe it was a compiled binary (such as
> a compiled VM) that the WSL system did not recognize, or maybe WSL
> was not smart enough to figure out how to evaluate a shell script,
> I don't know.
> > Travis (without explicit OS setting, so I'm assuming unix as well) says:
> > squeak: could not find any display driver
> Travis is probably running on a real Unix system (or Linux, which
> is very similar). Whatever it is, you can safely bet that it does
> not provide a graphical display system such as X11, because a CI
> system such as Travis is intended to run things remotely on a
> server with no graphical user interface. So most likely, you are
> trying to run a VM with graphical display on an operating system
> that does not provide display services.
> A Squeak VM will normally try to find a graphical display driver
> unless you explicitly tell it (with a command line option) not to
> do so. If you just run Squeak on a server with no X11 (or similar)
> installed, the VM will try to open a display module, and when it
> fails, it will give you an error message:
> platforms/unix/vm/sqUnixMain.c: fprintf(stderr, "squeak: could not find any display driver\n");
> The solution for this problem is specific to the Unix VM (in other
> words, don't try this on your Windows VM). You can run the VM without
> using an active display by using the '-vm-display-null' command
> line parameter. On a Unix system, run "squeak -help" to see the
> available options.
> Thus, if you had a command such as this for running Squeak:
> ./squeak foo.image bar.st
> Then you can run it in "headless" mode like this:
> ./squeak -vm-display-null foo.image bar.st
> The Unix Squeak VM has loadable VM modules for things like soound
> and the display, so -vm-display-null tells the VM to load the null
> display driver instead of the vm-display-X11 or vm-display-Quartz
> > To run a script in headless mode, I should not need any graphical output? How can I achieve this? I would greatly appreciate your help!
> > Best,
> > Christoph
> > _______________________________________________
> > Beginners mailing list
> > Beginners at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/mailman/listinfo/beginners
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
Beginners mailing list
Beginners at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners