[Asdf-devel] Registering preloaded systems for Quicklisp/ASDF

Faré fahree at gmail.com
Sat Aug 9 21:16:33 UTC 2014


Sorry, but doesn't it work to set *immutable-systems* AFTER you load everything?
I admit there not yet a test for this functionality in the asdf test suite;
it may be that the functionality is buggy and/or its API suboptimal,
and you're welcome to suggest patches and/or suggestions.

—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org
Gun: weapon of individual vs individual. Bomb: weapon of group vs group.
That's why collectivists hate guns and love bombs.



On Sat, Aug 9, 2014 at 3:49 PM, Dave Cooper <david.cooper at genworks.com> wrote:
>
> Here is a hack which seems to work for the moment but clearly is not the
> Right Way, because it's doing surgery on asdf::*defined-systems*.
>
> [assume `known-preloaded-systems' is a list of strings naming the known
> preloaded systems]:
>
>
>    (dolist (system known-preloaded-systems)
>       (setf (gethash system asdf::*defined-systems*)
>              (cons nil (make-instance 'asdf:system :name system))))
>
>
> But I think this is effectively what I want to achieve here.
>
>
>
>
>
> On Sat, Aug 9, 2014 at 3:27 PM, Dave Cooper <david.cooper at genworks.com>
> wrote:
>>
>>
>> Faré wrote:
>> >
>> >  Using asdf 3.1, you can use *immutable-systems* for that (see its
>> > docstring).
>> >
>>
>> Ok... After initializing Quicklisp and ASDF, I do:
>>
>>   (setq asdf:*immutable-systems* (uiop:list-to-hash-set "gendl" ... ))
>>
>> as well as
>>
>>  (asdf/find-system:register-preloaded-system "gendl")
>>  ...
>>
>> with all the known preloaded systems.
>>
>>
>> But now if I do
>>
>>   (ql:quickload :gendl)
>>
>> I still get this error:
>>
>>    "Requested system gendl is in the *immutable-systems* set, but not
>> loaded in memory"
>>
>> Apparently,
>>
>>    (asdf:system-registered-p "gendl")
>>
>> is still coming back as NIL.
>>
>> Is there another step I should be doing?
>>
>>
>>
>>
>>
>> On Sat, Aug 9, 2014 at 1:09 AM, Faré <fahree at gmail.com> wrote:
>>>
>>> On Fri, Aug 8, 2014 at 10:54 PM, Dave Cooper <david.cooper at genworks.com>
>>> wrote:
>>> > Hi, I know this has been discussed, but what is currently the best
>>> > practice
>>> > for registering a preloaded system after loading Quicklisp?  That is, I
>>> > have
>>> > a pre-built image with some Quicklisp/ASDF systems in it, which were
>>> > loaded
>>> > through so-called monolithic-fasls (now known as compile-bundles). So
>>> > the
>>> > pre-built image doesn’t itself have ASDF or Quicklisp.
>>> >
>>> > A downstream user then loads Quicklisp and ASDF (I take steps to ensure
>>> > that
>>> > they are loading the matching version of ASDF and Quicklisp as was used
>>> > to
>>> > build the image).  Now I need to do something to tell Quicklisp and
>>> > ASDF
>>> > that certain systems are already loaded in this image, so it won’t try
>>> > to
>>> > re-load them as depended-upon systems. In this specific case, I don't
>>> > want
>>> > it to try to fetch and reload Gendl when the user does (ql:quickload
>>> > ...) on
>>> > an application which :depends-on :gendl (because gendl is already built
>>> > into
>>> > this image).
>>> >
>>> > asdf/find-system:register-preloaded-system seems like it should be the
>>> > answer if we’re talking about plain ASDF, because it will prevent ASDF
>>> > from
>>> > raising a “missing-component” error for the system in question, if some
>>> > other system :depends-on it and yet no source code is found.  But in my
>>> > case
>>> > I can’t guarantee that “no source code is found.” The source might be
>>> > there
>>> > in the quicklisp dist directory. So apparently I need something
>>> > stronger
>>> > than register-preloaded-system? Or something else?
>>> >
>>> Using asdf 3.1, you can use *immutable-systems* for that (see its
>>> docstring).
>>>
>>> There is currently no provision to do it as part of a program-op, so
>>> you may have to do it manually between a load-op and a program-op, or
>>> as part of an image-dump-hook or image-restore-hook, contingent on a
>>> variable that gets reset (the image-dump-hook doesn't work on ECL, and
>>> you must use the ECL-specific epilogue instead; the image-dump-hook
>>> wastes a little bit of time at restart on other platforms).
>>>
>>> —♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics•
>>> http://fare.tunes.org
>>> The problem with socialism is that eventually you run out of
>>> other people's money. — Margaret Thatcher
>>
>>
>>
>>
>> --
>> My Best,
>>
>> Dave Cooper, Genworks Support
>> david.cooper at genworks.com, dave.genworks.com(skype)
>> USA: 248-327-3253(o), 1-248-330-2979(mobile)
>> UK: 0191 645 1699
>
>
>
>
> --
> My Best,
>
> Dave Cooper, Genworks Support
> david.cooper at genworks.com, dave.genworks.com(skype)
> USA: 248-327-3253(o), 1-248-330-2979(mobile)
> UK: 0191 645 1699




More information about the asdf-devel mailing list