[asdf-devel] dependency bug?
Robert Brown
robert.brown at gmail.com
Sat Jan 23 19:13:00 UTC 2010
Thanks very much for the suggestions.
My example code was a simplification of a more complicated system
definition, part of an project where I'm implementing Google's
protocol buffers in Lisp.
http://github.com/brown/protobuf/blob/master/protobuf.asd
Protocol description files (suffix .proto) need to be converted
into Lisp source, which is then compiled and loaded. I'm trying
to get the dependencies right in one of my COMPONENT-DEPENDS-ON
methods.
Anyway, back to my simple example. When I use
(:cl-source-file "bug2" :depends-on ("bug1"))
the ASDF component for bug2 ends up with the following IN-ORDER-TO slot:
((ASDF:LOAD-OP (ASDF:LOAD-OP "bug1"))
(ASDF:COMPILE-OP (ASDF:COMPILE-OP "bug1")))
I don't understand this. I believe it should be:
((ASDF:LOAD-OP (ASDF:LOAD-OP "bug1"))
(ASDF:COMPILE-OP (ASDF:LOAD-OP "bug1")))
and in fact when do
# touch bug1.lisp
(asdf:operate 'asdf:compile-op 'bug)
component bug1 is loaded (the source is compiled and then the fasl
is loaded), not just compiled, before bug2 is compiled.
My goal is to understand what the ASDF operations mean. LOAD-OP
means "compile and load my code". However, COMPILE-OP seems to
have two different meanings. COMPILE-OP means "compile" when
it's a goal to perform, but it means "compile and load" when it's
a dependency of another goal. Does that sound right?
It's confusing me because we already have an operator that
functions as "compile and load", namely LOAD-OP.
bob
=====================
On Fri, Jan 22, 2010 at 9:05 PM, Robert Goldman <rpgoldman at sift.info> wrote:
> On 1/22/10 Jan 22 -6:20 PM, Robert Brown wrote:
>> 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.
>
> Try this with no :in-order-to, just
>
> (:file "bug2" :depends-on ("bug1"))
>
> and see if that does what you expect.... If not, get back to us, ok?
>
> cheers,
> r
More information about the asdf-devel
mailing list