Thanks again for responding to my questions. I've interleaved a few comments below.
On 1/23/10, Robert Goldman rpgoldman@sift.info wrote:
On 1/23/10 Jan 23 -1:13 PM, Robert Brown wrote:
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.
I may be able to help with this --- I have some examples of cases where I have written preprocessors that turn some outside languages into lisp through preprocessing.
I believe I have something that works, but it's a bit suboptimal. For each proto file I have 2 components, one that converts the proto file into a Lisp source file, and a second that compiles and loads the Lisp code. It would be nice to combine these two components into just one ASDF component.
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")))
I suppose. I like to think that it means "load my code" and that the dependency ensures that the file is compiled first.
Have you tried looking at component-do-first as well as in-order-to?
I think I see what's going on now. In addition to the IN-ORDER-TO dependencies, ASDF records an additional dependency in the DO-FIRST slot. When :depends-on is specified, the DO-FIRST slot is set:
(setf (slot-value ret 'do-first) `((compile-op (load-op ,@depends-on))))
This is strange to me. Why put dependencies in two different places? The DO-FIRST dependency cannot be supplied by providing a new implementation of the COMPONENT-DEPENDS-ON method. It's only set when :depends-on is used in the system definition.
I'm unfamiliar with ASDF internals, but I think the semantics of ASDF dependencies would be more straightforward if DO-FIRST were removed and IN-ORDER-TO used for all dependencies.
Your test case is a good one, too, since I don't believe the manual actually clearly specifies how to create a new operation or component class, which methods must be defined, etc
Yes, it would be awesome to know without looking at the code what needs to be done to add component build rules.
Cheers, r
Thanks again.
bob