> 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."
>
This is the reason why asdf3 has register-image-restore-hook
and register-image-dump-hook, so you may register functions that
(re)initialize variables that hold such paths when you restore your image
(which also runs the function immediately by default)
and unbind them before you dump a new image (which doesn't).

> 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.
>
Well, if asdf:system-relative-pathname is called while evaluating
the defvar or defparameter, then it must be called again
when the image is restored.

I should probably define a (define-image-variable ...) or some such
that automatically registers a function to re-initialize the variable
when the image is restored.

Of course, you must then update all relevant libraries to use it.

> 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).
>
If that's the route you choose, instead of the one that consists
in fixing libraries to take image restore and dump into account,
you could use ASDF's fasl-op or monolithic-fasl-op to deliver those fasls.

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
I have never let my schooling interfere with my education. — Mark Twain

_______________________________________________
asdf-devel mailing list
[email protected]
http://lists.common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel

Reply via email to