loading lisp files from inside the java jar

Zach Beane xach at xach.com
Tue Aug 18 12:21:23 UTC 2015


"Pascal J. Bourguignon" <pjb at informatimago.com> writes:

>>> On Aug 18, 2015, at 14:35 , Hamda Binte Ajmal <hamda.binte.ajmal at gmail.com> wrote:
>>> 
>>> To be more specific
>>> 
>>> The load statement looks like
>>> (load "jar:file:C:/Users/Administrator.NUIG-1Z7HN12/Documents/NetBeansProjects/Interface/dist/Profet.jar!/aima/quicklisp/setup.lisp")
>>> 
>>> and the error thrown is
>>> 
>>> "Unhandled lisp condition: Can't ensure directory
>>> #P"jar:file:C:/Users/Administrator.NUIG-1Z7HN12/Documents/NetBeansProjects/Interface/dist/Profet.jar!/./" 
>>> ancestor of
>>>  #P"jar:file:C:/Users/Administrator.NUIG-1Z7HN12/Documents/NetBeansProjects/Interface/dist/Profet.jar!/cache/asdf-fasls/07y1rt/asdf.abcl"."
>
> At last!
>
>
> So the problem you have here is that when loading setup.lisp it tries
> to compile asdf.lisp and to save the fasl file INSIDE the jar, as per
> the cache directory determined by setup.lisp.
>
> IIRC, quicklisp respects the XDG Base Directory Specification to find
> out the cache directory where to save the fasl.  So one option could
> be to set the required XDG environment variables to direct it
> elsewhere than inside the jar.
>
>   $ export XDG_CACHE_HOME=$HOME/.cache
>   $ abcl
>
> could help.
>
> You might want to send a feature request to Xach (quicklisp) so that
> it would detect this situation and adjust to a more convenient
> behavior.

Quicklisp does not look at XDG environment variables. The intent is that
if no sufficiently-new ASDF is already loaded, it will try to compile to
a fasl file in ~/quicklisp/cache/asdf-fasls/<hash>/.

I was going to suggest loading a sufficiently new ASDF before trying to
load the quicklisp/setup.lisp file.

However, now that I look at the Quicklisp setup code, I see that it
*unconditionally* does (ensure-directories-exist ...) on the asdf fasl
cache directory, even though it should only be done if Quicklisp needs
to compile its own ASDF.

I think one option is to preload the asdf-fasl cache and put that in the
jar.

I'll open a Quicklisp issue for the unconditional fasl cache directory
creation problem and try to fix it soon.

Zach





More information about the armedbear-devel mailing list