ASDF is behaving in a way I find mysterious. Maybe I've found a bug, but more likely I just don't understand ASDF dependencies.
To demonstrate the problem, create the three files below.
========== bug.asd ==========
(cl:in-package #:common-lisp-user)
(defpackage #:bug-system (:use #:common-lisp #:asdf))
(in-package #:bug-system)
(defsystem bug :components ((:cl-source-file "bug1") (:cl-source-file "bug2" :in-order-to ((load-op (load-op "bug1")) (compile-op (load-op "bug1"))))))
========== bug1.lisp ==========
(defun bug1 ())
========== bug2.lisp ==========
(defun bug2())
==========
Execute the following:
(load "bug.asd") (let ((*load-verbose* t)) (asdf:operate 'asdf:load-op 'bug))
Next, exit your Lisp session, start up your Lisp environment again and execute the two lines above for a second time. ASDF recompiles bug2.lisp. I expect it to instead just load bug2.fasl.
Can someone explain what's going on?
My example is intended to mirror the situation where you need to have some in-line functions or macros loaded into the Lisp system before another file can be compiled or loaded. Maybe I should be expressing this dependency differently to ASDF.
bob
Oh, yes, and if you want to see what will happen, try
(load "bug.asd")
(pprint (asdf::traverse (make-instance 'asdf:load-op) (asdf:find-system :bug))
that should display the plan that ASDF has developed for your system without executing it.
best, r
Robert Brown robert.brown@gmail.com writes:
ASDF is behaving in a way I find mysterious. Maybe I've found a bug, but more likely I just don't understand ASDF dependencies.
To demonstrate the problem, create the three files below.
========== bug.asd ==========
(cl:in-package #:common-lisp-user) (defpackage #:bug-system (:use #:common-lisp #:asdf)) (in-package #:bug-system) (defsystem bug :components ((:cl-source-file "bug1") (:cl-source-file "bug2" :in-order-to ((load-op (load-op "bug1")) (compile-op (load-op "bug1"))))))
If I understand correctly what you want to achieve (that "bug1.lisp" is compiled and loaded before "bug2.lisp"), then this is usually done by
(defsystem bug :components ((:file "bug1") (:file "bug2" :depends-on ("bug1"))))
Or alternatively,
(defsystem bug :serial t ; sequential dependency graph along textual order :components ((:file "bug1") (:file "bug2")))
(s/:file/:cl-source-file/g if you want so but that distinction is usually not needed.)
-T.