30 Mar 2006 crhodes   » (Master)

We released McCLIM 0.9.2 ("Laetare Sunday" – go silly names for releases!) and SBCL 0.9.11 at the weekend.

One relatively new feature in SBCL is the ability to make executable images in a fairly straightforward manner: simply pass :executable t to sb-ext:save-lisp-and-die, and the system will attempt to dump one file that plays relatively nice with the executable loader on your given system. Since it is fair to say that there are a large number of dependencies in McCLIM, and additionally a non-dependency that is in practice needed to get windows to display on the screen, it seemed reasonable to use this executable-generating functionality to distribute a binary that could be tried out before deciding whether or not to get the source to a fair number of software projects.

So, Andreas Fuchs duly stepped up to build a binary of mcclim-0.9.2 for x86/linux, and all seemed well. However, I remembered that some people had expressed an interest in a Mac OS X binary, so I went about building one of those[*]. And all seemed well; a few things had to be changed from Andreas' binary, mostly because SBCL on x86/linux supports threading, while on ppc/darwin it has to make do with select(). However, trying the binary revealed some odd things going on: using Apple's X11.app, you would need to hit RET twice to get your input accepted: only not quite systematically: also, sometimes, the REPL's answer would only appear after a subsequent keystroke.

Amusingly, the same behaviour was far less systematic when running the same binary over an ssh-forwarded connection to an xorg server. This is perhaps not overly surprising, but it did make debugging the problem, or even identifying the proximate cause, a lot harder. Tim Moore and Juho Snellman did end up tracking it down, though: Tim worked out that read-char-no-hang was hanging, and Juho spotted an error in a recent bugfix in SBCL for listen: sometimes the system would report that data was available on a socket even when it wasn't. The difference in behaviour of the buggy binary between X servers is I think explained by a difference in double-buffering: Apple's windows are double buffered, so they never receive any Expose events, whereas xorg's aren't, and so they receive many more events in total; and a failure to respond in a timely manner to an Expose event is less noticeable than not doing anything when hitting the Return key...

The upshot is that SBCL 0.9.11 is unfortunately unsuitable for McCLIM work; however, armed with a hotfix for listen, I have made available an OS X binary of mcclim 0.9.2 for people to try: you'll need X to be running, and also to have libfreetype.dylib in /usr/X11R6/lib/.

[*] For the record, the build script ended looking like this for OS X:

(mapcar #'require
        '(:asdf :clx :mcclim :mcclim-freetype
          :clim-listener :clouseau :swank :clim-examples :functional-geometry))
(load "/isms/home/mas01cr/lisp/cvs/clnet/mcclim/Apps/Debugger/clim-debugger.lisp")
;;; listener fixes / demo commands
(clim:define-command-table clim-listener::demo-commands)
(clim:define-command (clim-listener::com-plot-fishes
                      :name "Plot Fishes with Functional Geometry"
                      :command-table clim-listener::demo-commands :menu t
                      :provide-output-destination-keyword t)
  (functional-geometry::clim-plot functional-geometry::*fishes*))
(clim:define-command (clim-listener::com-show-demos
                      :name "Show McCLIM Demos"
                      :command-table clim-listener::demo-commands :menu t
                      :provide-output-destination-keyword t)
   (clim:make-application-frame 'clim-demo::demodemo)))
 :inherit-from '(clim-listener::application-commands
                 clim-listener::show-commands clim-listener::demo-commands)
 :menu '(("Application" :menu clim-listener::application-commands)
         ("Lisp"        :menu clim-listener::lisp-commands)
         ("Filesystem"  :menu clim-listener::filesystem-commands)
         ("Show"        :menu clim-listener::show-commands)
         ("Demos"       :menu clim-listener::demo-commands))
 :errorp nil)
(push (lambda ()
        (setf mcclim-freetype::*freetype-font-path*
               (make-pathname :directory '(:relative "fonts"))
                :directory (pathname-directory sb-ext:*core-pathname*))))
(setf sb-ext:*invoke-debugger-hook* #'clim-debugger:debugger)
(sb-ext:save-lisp-and-die "/tmp/mcclim-listener-0.9.2/mcclim"
                          :executable t
                          :toplevel (lambda ()
                                      (sb-ext:quit :unix-status 0)))

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!