[asdf-devel] clearing output-translations for a "dumped" image
Anton Vodonosov
avodonosov at yandex.ru
Fri Mar 1 18:32:21 UTC 2013
Dave, do you have success with moving saved lisp image to new machine/directory,
when the image has asdf and quicklisp loaded?
I am trying this too, and (asdf:clear-configuration) is not enough for systems
loaded from quicklisp.
For example many libraries keep static files, like .html, .css in their repositories.
And at run-time access these resources with asdf:system-relative-pathname.
The simplest example is hunchentoot. If you do
(ql:quickload :hunchentoot)
(hunchentoot:start (make-instance 'hunchentoot:easy-acceptor :port 4242))
and open http://127.0.0.1:4242/ you see hunchentoot default page and documentation.
These pages are served from quicklisp\dists\quicklisp\software\hunchentoot-1.2.7\www\
When I save a lisp image and copy the image together with quicklisp/ directory
to another location, the libraries can not locate their static files. In my example,
hunchentoot says "The requested URL / was not found on this server."
I have tried to (asdf:clear-configuration) before saving the image and after
image is restored to
(setf ql:*quicklisp-home* (truename (merge-pathnames "quicklisp/" *default-pathname-defaults*)))
(ql:setup)
but it didn't help.
So saving lisp image only work for me in tiny applications where I know there
is no need for resources from file system.
For general use, where application depends on many libraries I am afraid there
is no way to make relocatable lisp images. Even if I find a way to reinitialize
asdf and quicklisp configurations, there are libraries which have their own custom
variables holding file system paths. For such applications I only see one reliable
way - prebuild all the .fals files with disabled asdf-output-translations so that
.fals files are placed near the sources. Then copy full application and library
sources to new location and reload them by (load "quicklisp/setup.lisp") (ql:quickload :my-application).
Best regards,
- Anton
More information about the asdf-devel
mailing list