Re: asdf dependency question

Brian Seitz <[email protected]>
Newsgroups gmane.lisp.cclan.general
Message-ID <[email protected]>
On Sun, 20 Oct 2002, Daniel Barlow wrote:

> [email protected] (Simon András) writes:
>
> > Unlike mk-defsystem, asdf doesn't recompile a file when files it
> > depends on have changed. Is there a way to achieve this?
[snip]
> Can you produce a test case?

The following is an explicit test case for the problem the original poster
stated (others have suggested the same situation).  I suspected my own
heretical additions of last-loaded and last-compiled to be the cause of
this problem, so I thought I should investigate.  But I tried a version of
asdf before those were committed and it still had the same problem.

I have a really slow and probably even more heretical fix for this problem
that has (operation-done-p ((o operation) (c source-file)) check the
last-compiled of c against all its dependencies.  But there's probably a
better way.

It's debatable how much of a bug this is.  It's primarily (only?) a
problem with redefining macros, but I think LISP developers are wary of
this anyway.  It would be a problem with *adding* new classes, except that
you would be editing the dependent file to use the new class, so it will
get recompiled anyway.  There might be some obscure case I'm not thinking
about here, though.  Anyway, here's the test case:

test.asd:
;;; -*- mode: common-lisp -*-

(asdf:defsystem test
    :components ((:file "test1")
		 (:file "test2" :depends-on ("test1"))))

test1.lisp:
;;; -*- mode: common-lisp -*-

(in-package :user)

(defmacro hooha ()
  35)


test2.lisp:
;;; -*- mode: common-lisp -*-

(in-package :user)

(defun foo ()
    (hooha))


CL-USER(8): (asdf:oos 'asdf:load-op "test")
;;; Compiling file /data/dragon1/bseitz/work/reload/test1.lisp
;;; Writing fasl file /data/dragon1/bseitz/work/reload/test1.fasl
;;; Fasl write complete
; Fast loading /data/dragon1/bseitz/work/reload/test1.fasl
;;; Compiling file /data/dragon1/bseitz/work/reload/test2.lisp
;;; Writing fasl file /data/dragon1/bseitz/work/reload/test2.fasl
;;; Fasl write complete
; Fast loading /data/dragon1/bseitz/work/reload/test2.fasl
((ASDF:LOAD-OP . #<ASDF:SYSTEM "test" @ #x450394a>)
 (ASDF:LOAD-OP . #<ASDF:CL-SOURCE-FILE "test2" @ #x4507522>)
 (ASDF:COMPILE-OP . #<ASDF:SYSTEM "test" @ #x450394a>)
 (ASDF:COMPILE-OP . #<ASDF:CL-SOURCE-FILE "test2" @ #x4507522>)
 (ASDF:LOAD-OP . #<ASDF:CL-SOURCE-FILE "test1" @ #x4507402>)
 (ASDF:COMPILE-OP . #<ASDF:CL-SOURCE-FILE "test1" @ #x4507402>))
CL-USER(9): (foo)
35 [*** CORRECT!]

[EDIT AND SAVE test1.lisp.  I changed 35 to 25.]

CL-USER(10): (asdf:oos 'asdf:load-op "test")
;;; Compiling file /data/dragon1/bseitz/work/reload/test1.lisp
;;; Writing fasl file /data/dragon1/bseitz/work/reload/test1.fasl
;;; Fasl write complete
; Fast loading /data/dragon1/bseitz/work/reload/test1.fasl
((ASDF:LOAD-OP . #<ASDF:SYSTEM "test" @ #x4667842>)
 (ASDF:LOAD-OP . #<ASDF:CL-SOURCE-FILE "test2" @ #x4672732>)
 (ASDF:COMPILE-OP . #<ASDF:SYSTEM "test" @ #x4667842>)
 (ASDF:COMPILE-OP . #<ASDF:CL-SOURCE-FILE "test2" @ #x4672732>)
 (ASDF:LOAD-OP . #<ASDF:CL-SOURCE-FILE "test1" @ #x4666c2a>)
 (ASDF:COMPILE-OP . #<ASDF:CL-SOURCE-FILE "test1" @ #x4666c2a>))
CL-USER(11): (foo)
35 [*** WRONG!]
CL-USER(12): (delete-file "test2.fasl")
T
CL-USER(13): (asdf:oos 'asdf:load-op "test")
;;; Compiling file /data/dragon1/bseitz/work/reload/test2.lisp
;;; Writing fasl file /data/dragon1/bseitz/work/reload/test2.fasl
;;; Fasl write complete
; Fast loading /data/dragon1/bseitz/work/reload/test2.fasl
((ASDF:LOAD-OP . #<ASDF:SYSTEM "test" @ #x4667842>)
 (ASDF:LOAD-OP . #<ASDF:CL-SOURCE-FILE "test2" @ #x4672732>)
 (ASDF:COMPILE-OP . #<ASDF:SYSTEM "test" @ #x4667842>)
 (ASDF:COMPILE-OP . #<ASDF:CL-SOURCE-FILE "test2" @ #x4672732>)
 (ASDF:LOAD-OP . #<ASDF:CL-SOURCE-FILE "test1" @ #x4666c2a>)
 (ASDF:COMPILE-OP . #<ASDF:CL-SOURCE-FILE "test1" @ #x4666c2a>))
CL-USER(14): (foo)
25 [*** CORRECT!]



-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm 
Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.