Hi, How do I distribute an application built using asdf? Specifically, given file foo.lisp, I need the list of all the fasl files of all the files on which foo.lisp depends (+ foo.fasl) in the correct order of loading. Thanks!
Dear Sam,
in a first approximation, you could use something like:
(defun all-steps-for-system (system) (asdf::traverse (make-instance 'asdf:load-op :force t) (asdf:find-system system)))
Then you could find all the files produced in order with:
(defun all-files-for-system (system) (loop :for (operation . component) :in (all-steps-for-system system) :for output-files = (asdf:output-files operation component) :append output-files))
Problem A: there might be more than fasls amongst files produced, e.g. object files produced by cffi-grovel.
Problem B: files and systems loaded outside of the asdf dependency mechanism proper are untracked. These include systems loaded from .asd files directly, either by an explicit (asdf:load-system ...) or by a :defsystem-depends-on declaration. Some systems rely on that, e.g. iolib when it depends on cffi-grovel. Solving this problem will require modifying ASDF to basically trace load-system. OR we could modify the loading so as to track which components were needed
XCVB solves these problems - actually xcvb-master works exactly that way. However, I haven't done the hard work to support linking .o files into single image deliverables, since it's a portability hell.
PS: thanks a whole lot for including ASDF in CLISP and keeping it up to date!
[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ] Brain, n.: The apparatus with which we think that we think. — Ambrose Bierce, "The Devil's Dictionary"
On 29 December 2010 03:31, Sam Steingold sds@gnu.org wrote:
Hi, How do I distribute an application built using asdf? Specifically, given file foo.lisp, I need the list of all the fasl files of all the files on which foo.lisp depends (+ foo.fasl) in the correct order of loading. Thanks! -- Sam Steingold (http://sds.podval.org/) on Ubuntu 10.04 (lucid) http://iris.org.il http://ffii.org http://memri.org http://jihadwatch.org http://palestinefacts.org http://openvotingconsortium.org I'd give my right arm to be ambidextrous.
Dear Faré,
- Faré snuerr@tznvy.pbz [2010-12-29 03:59:39 +0100]:
(defun all-steps-for-system (system) (asdf::traverse (make-instance 'asdf:load-op :force t) (asdf:find-system system)))
(defun all-files-for-system (system) (loop :for (operation . component) :in (all-steps-for-system system) :for output-files = (asdf:output-files operation component) :append output-files))
this is a good start: I can take all files in the list up to the file which I actually need. however, this might include files which I don't need. e.g., supposed my system includes file A,B,C and B&C depend on A but not on each other. Your function all-files-for-system will produce A.fas B.fas C.fas or A.fas C.fas B.fas if I want to distribute B and everything it needs (i.e., A+B), I will distribute A+B in the first case and A+C+B in the second one. So, is there a way to get the list of compiled files which are needed to compile just one file? e.g., can I pass a file as the argument to all-files-for-system? (obviously, it will not work for the above code, but maybe there is some other incantation?)
thanks!
(defun all-files-for-system (system) (loop :for (operation . component) :in (all-steps-for-system system) :for output-files = (asdf:output-files operation component) :append output-files))
this is a good start: I can take all files in the list up to the file which I actually need. however, this might include files which I don't need. e.g., supposed my system includes file A,B,C and B&C depend on A but not on each other.
Unhappily, ASDF isn't designed to deal with individual files as targets. (XCVB is, but that might not doesn't help you much unless you convert all the dependencies to use XCVB, which is easy in the easy case, but can be work in the hard case).
(defun all-steps-for-component (component) (asdf::traverse (make-instance 'asdf:load-op :force t) (asdf:find-component component nil)))
(defun all-files-for-component (component) (loop :for (operation . component) :in (all-steps-for-component component) :for output-files = (asdf:output-files operation component) :append output-files))
You could kind of do it manually: first use all-files-for-component to collect the files for all the dependencies for each of the systems that your system depends on, then use (all-files-for-component '(:foo "module" "file")) e.g. (all-files-for-component '(:fare-utils "base" "macros")) to get the dependencies for the specific file within the system. Concatenate the whole thing, and finally use remove-duplicates :from-end t. Good luck!
[ François-René ÐVB Rideau | Reflection&Cybernethics | http://fare.tunes.org ] Reality must take precedence over public relations, for Mother Nature cannot be fooled. — R.P. Feynman