Nov 07,
2017

Goodbye Roswell

Roswell is a multi-platform Lisp installer and launcher; if the reader is familiar with Clojure it could be seen roughly as the equivalent of Leiningen. Yesterday I've decided to say goodbye and thank for all the fish to Roswell and proceeded to remove it and install SBCL the old trusted way, directly from source.

Roswell has some neat offerings, like installing with a single command a Lisp implementation like CCL or SBCL, download and configure Quicklisp or build an executable from a project.

When the installation works.

In my case, more than a single time, when I've tried to upgrade it I ended up with some errors. Nothing that I couldn't solve with some pronging, but that elided the usefulness of the tool1.

The biggest problem I've found was the installation from scratch. Quite often it ended with a somewhat strange error in a bizarre place of the system, the hostname-util.c file, or in other words, the fail pointed to the famous systemd.

The bane of IT

Well, not exactly.

As I've said before, contrary to the loud majority I'm OK with systemd. Frankly, creating an init system better than a bunch of shell scripts isn't placing a bar really high.

Anyway, this is the error message:

$ Assertion 'uname(&u) >= 0' failed at ../src/basic/hostname-util.c:55, function gethostname_malloc(). Aborting.

I was a little puzzled because there aren't a lots of thing that could go wrong in the gethostname_malloc() function, unless the error is caused by lack of RAM. To deepen the mystery, on the same system I can build SBCL inside a tmpfs partition2, so RAM is aplenty.

I've looked at the bug reports and found at least one with the same error message and probably digging deep enough I could have isolated the problem, but sometimes the pragmatism wins. In this case, installing it from sources didn't create a lot of friction, unfortunately this means that deploying has became more complicated.

Installation Notes

I decided to put the SBCL installation in my home directory. For the compilation it requires an ANSI compliant Common Lisp implementation, other than that I don't usually build it with --fancy features enabled as I stick with the defaults:

$ mkdir -p ~/.local/share/sbcl
$ sh ./make.sh
$ INSTALL_ROOT=~/.local/share/sbcl sh ./install.sh

I'm using Zsh so I've added the binaries path in my .zshenv file:

# add SBCL common lisp to PATH
if [[ -d "$HOME/.local/share/sbcl/bin" ]]; then
    export PATH="$HOME/.local/share/sbcl/bin:$PATH"
    export SBCL_HOME="$HOME/.local/share/sbcl/lib/sbcl"
fi

If it's not already installed, I then proceed to download and configure Quicklisp, that means adding my local project directory path in the ~/.sbcl.rc file:

#+quicklisp
(progn
  (pushnew #P"/path/to/sources/lisp/"
           ql:*local-project-directories*))

Profit?

Edit

The Stow version of the instructions above became:

$ sh ./make.sh --with-sb-core-compression
$ SBCL_HOME="" INSTALL_ROOT=/usr/local/stow/$(basename $(pwd)) sh ./install.sh
$ stow -D sbcl-currently-installed-version -S $(basename $(pwd))

where --with-sb-core-compression is applied to add zlib compression for core images and $(basename $(pwd)) usually expands to sbcl-version-number, if upstream doesn't change the naming format of their archives. Invoking Stow from the current directory should work when configured properly.3


  1. well, Leiningen isn't perfect too, more than once I ended up wiping the installation directory and starting from scratch ↩︎

  2. tmps are file systems mounted on the system's RAM ↩︎

  3. Managing Applications Installed From Source With Stow ↩︎