Re-building stale FASL files after ACL upgrade
Saturday, November 6, 2004
I mentioned the availability of ACL 7.0 last month. For those of you who are upgrading, there is always the hassle of re-compiling fasl's from a previous release. However, just recently, I came across this solution on the ASDF CLiki page:
If you update your Lisp to a version that uses a different fasl-format you get a diskfull of stale fasls that ASDF will try to load in good faith, with predictable and unpleasant results.Since I use ASDF for all my projects, this went into my init file the moment I came across it! Does anyone know what the equivalents would be for CLISP and LispWorks?
The ugly brute force solution is to find and delete all the fasls -- but there are better ways. Add the following around-method to your .lisp-init, .sbclrc, or equivalent:;;; If the fasl was stale, try to recompile and load (once). Since only SBCL ;;; has a separate condition for bogus fasls we retry on any old error ;;; on other lisps. Actually, Allegro has a similar condition, but it's ;;; unexported. Works nicely for the ACL7 upgrade, though. (defmethod asdf:perform :around ((o asdf:load-op) (c asdf:cl-source-file)) (handler-case (call-next-method o c) (#+sbcl sb-ext:invalid-fasl #+allegro excl::file-incompatible-fasl-error #-(or sbcl allegro) error () (asdf:perform (make-instance 'asdf:compile-op) c) (call-next-method))))

