Look at the following Symbolics System Definition:
;;;(sct:defsystem :foo ;;; (:default-pathname "scratch/" ;;; :default-module-type :lisp) ;;; ;;; (:module foo ("FOO")) ;;; ;;; (:module bar ("BAR") ;;; (:in-order-to (:compile :load) (:load foo))) ;;; ;;; )
I translated this to ASDF as follows:
(ASDF:DEFSYSTEM :FOO :COMPONENTS ((:MODULE FOO :PATHNAME "" :COMPONENTS ((:FILE "foo"))) (:MODULE BAR :PATHNAME "" :COMPONENTS ((:FILE "bar")) :IN-ORDER-TO ((ASDF:COMPILE-OP (ASDF:LOAD-OP FOO)) (ASDF:LOAD-OP (ASDF:LOAD-OP FOO))))))
This is not exactly equivalent, because the semantics of :IN-ORDER-TO is different in Symbolics SCT and ASDF.
However I get a very strange behavior of the ASDF System.
I write the ASDF:DEFSYSTEM form in a file "scratch/sysdcl.lisp" I compiled the system and then restarted Lisp in order to load the system:
CL-USER(2): (load "scratch/sysdcl") ; Loading /home/usr/benni/lisp/scratch/sysdcl.lisp T CL-USER(3): (asdf:find-system :foo) #<ASDF:SYSTEM "foo"> CL-USER(4): (asdf:load-system :foo) ; Fast loading /home/usr/benni/lisp/scratch/foo.fasl ;;; Compiling file /home/usr/benni/lisp/scratch/bar.lisp ;;; Writing fasl file /home/usr/benni/lisp/scratch/ASDF-TMP-bar.fasl ;;; Fasl write complete ; Fast loading /home/usr/benni/lisp/scratch/bar.fasl #<ASDF:LOAD-OP NIL @ #x7292bc42> CL-USER(5):
As you see it recompiles one of the files. This happens after each restart of Lisp (Allegro CL 8.1). ASDF:LOAD-SYSTEM each time recompiles "bar.lisp" even if no file is changed.
Output Translations were disabled by calling (ASDF:DISABLE-OUTPUT-TRANSLATIONS)
I believe that your problem may come from introducing the intermediate :modules. You may find that collecting the results of
(asdf::traverse (make-instance 'asdf:load-op) (find-system :foo))
Try rewriting your defsystem more along these lines:
(ASDF:DEFSYSTEM :FOO :COMPONENTS ((:FILE "foo")) (:FILE "bar" :depends-on ("foo")))
I will try to investigate this further (esp if you post a ticket to launchpad), but can't get to it for a while, so suggest you work around by revising the defsystem.
BTW, why is your system definition not in foo.asd?
best, r
Robert Goldman wrote:
I believe that your problem may come from introducing the intermediate :modules. You may find that collecting the results of
(asdf::traverse (make-instance 'asdf:load-op) (find-system :foo))
Try rewriting your defsystem more along these lines:
(ASDF:DEFSYSTEM :FOO :COMPONENTS ((:FILE "foo")) (:FILE "bar" :depends-on ("foo")))
However the intermediate :modules are correct and in any case when the compiler is invoked when no source changed is a bug of ASDF ?
I will try to investigate this further (esp if you post a ticket to launchpad), but can't get to it for a while, so suggest you work around by revising the defsystem.
BTW, why is your system definition not in foo.asd?
In my last mail you also see a commented out SCT:DEFSYSTEM form. That SCT:DEFSYSTEM form can be used in Genera and SCT:DEFSYSTEM furthermore is a macro developed by myself to be used in other Lisp systems (Allegro, CLISP). The ASDF:DEFSYSTEM form indeed is the macro expansion of the SCT:DEFSYSTEM form.
In order to have a straightforward implementation of the SCT:DEFSYSTEM macro, the structure of modules and files from the SCT:DEFSYSTEM is preserved. This explains where the intermediate modules come from.
All my Lisp programs were written under OpenGenera and there it is customary to have the system definition in a file "sysdcl.lisp". I just want to copy the Lisp source files from the Symbolics to another computer and execute (SCT:MAKE '(:FOO)) in the other Lisp in order to Load (and Compile if needed) the software there.
On 7/13/10 Jul 13 -2:25 AM, Benjamin Benninghofen wrote:
Robert Goldman wrote:
I believe that your problem may come from introducing the intermediate :modules. You may find that collecting the results of
(asdf::traverse (make-instance 'asdf:load-op) (find-system :foo))
Try rewriting your defsystem more along these lines:
(ASDF:DEFSYSTEM :FOO :COMPONENTS ((:FILE "foo")) (:FILE "bar" :depends-on ("foo")))
However the intermediate :modules are correct and in any case when the compiler is invoked when no source changed is a bug of ASDF ?
[warning: I am writing this from a conference, so I am not in a good position to verify or research. take the following with a grain of salt.]
Sort of.
It is a poorly-understood aspect of ASDF that the plan to build the above is not equivalent to the plan to build your original system.
My system's load plan will be something like:
compile-op, foo.lisp load-op, foo.lisp compile-op, bar.lisp compile-op, foo system load-op, bar.lisp load-op, foo system
[I am using "foo.lisp" to refer to the component of type cl-source-file, to distinguish from same-name components of other types...]
For your system, the plan will be something like:
compile-op, foo.lisp compile-op, module foo load-op, foo.lisp load-op, module foo compile-op, bar.lisp compile-op, module bar compile-op, foo system load-op, bar.lisp load-op, module bar load-op, foo system
Note that this plan is longer.
My bet (and I'm not really in a position to verify this right now, see above) is that ASDF doesn't realize that the module operations have been done already, so that it ends up thinking that bar's dependencies (which include the MODULE foo) have changed, so it adds additional operations.
I will try to investigate this further, but it might be a couple of weeks before I can dig in.
best, r
I will try to investigate this further (esp if you post a ticket to launchpad), but can't get to it for a while, so suggest you work around by revising the defsystem.
BTW, why is your system definition not in foo.asd?
In my last mail you also see a commented out SCT:DEFSYSTEM form. That SCT:DEFSYSTEM form can be used in Genera and SCT:DEFSYSTEM furthermore is a macro developed by myself to be used in other Lisp systems (Allegro, CLISP). The ASDF:DEFSYSTEM form indeed is the macro expansion of the SCT:DEFSYSTEM form.
In order to have a straightforward implementation of the SCT:DEFSYSTEM macro, the structure of modules and files from the SCT:DEFSYSTEM is preserved. This explains where the intermediate modules come from.
All my Lisp programs were written under OpenGenera and there it is customary to have the system definition in a file "sysdcl.lisp". I just want to copy the Lisp source files from the Symbolics to another computer and execute (SCT:MAKE '(:FOO)) in the other Lisp in order to Load (and Compile if needed) the software there.