On Fri, Aug 8, 2014 at 10:54 PM, Dave Cooper david.cooper@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