[asdf-devel] [cclan-list] How to depend on a system optionally?

Robert Goldman rpgoldman at sift.info
Mon Jul 20 23:39:55 UTC 2009


james anderson wrote:
> On 2009-07-21, at 00:58 , Robert Goldman wrote:
> 
>> Gary King wrote:
>>> I share Robert's queasiness and also think that we want ASDF to  
>>> support
>>> these sorts of dependencies (simple, weak, contingent, etc... (?)).
>>>
>>> I'm going to update the manual with James's table (thanks James!)  
>>> in the
>>> hopes of giving us a place to hang our collective hats.
>>>
>>>
>> [...]
>>
>> Follow-on suggestion:  we need to think about what happens when a
>> component has all possible combinations of :depends-on,
>> :weakly-depends-on, and :contingent-on.  Does something that would not
>> be loaded because of :contingent-on avoid a crash that would come  
>> from a
>> violated :depends-on?
> 
> hmmm... depends on what you mean by a "crash".
> it probably does not make sense to define a relation like
> 
> (:file "a" (:contingent-on :osx))
> (:file "b" (:depends-on "a"))
> 
> as that reads as if that "a" will always be present, which is likely  
> to cause confusion if the statements are not _real_ close neighbors  
> in the system description.
> 
> what does make sense is
> 
> (:module "x"
>    (:components ((:module :ffi
>                     (:components ((:file "a-ffi" (:contingent-on  
> "osx" :ccl))
>                                   (:file "a-inter" (:contingent-on "a- 
> ffi"))
>                                   (:file "b-ffi" (:contingent-on  
> "linux" :sbcl))
>                                   (:file "b-inter" (:contingent-on "b- 
> ffi")))))
>                  (:file "x-ops" (:depends-on :ffi)))

What about

(:file "foobar (:contingent-on (feature :macosx))
               (:weakly-depends-on (another-system))
               (:depends-on ("a-file")))

It seems like we'd want the :depends-on not to cause an error when
traversing the system if the :contingent-on fails....

What if the weakly-depends-on thing is supposed to establish the feature
we are contingent on?

We probably need to examine the 2^3 combinations here and figure out
what we intend.


>> Extra bonus follow-on:  are these expected to be meaningful when the
>> depended-on item is a system (clearly yes), a feature (seems  
>> handy), an
>> arbitrary component (what would this mean?)?
> 
> i have used contingent dependencies for all of them.

The current implementation of weakly-depends-on does not work for
anything but a system.
> 
> eg. if a graphics system is to be built somewhere where clx makes  
> sense, then there is a system dependency between the graphics package  
> and clx.
> in addition, there is a file-level dependency between the clx-based  
> implementation of rendering operators and clx's presence.
> 
> one _can_ express everything in terms of #+, but not as clearly.

#+ has different semantics, at least in the asdf-file than your
contingent-on, because the former is resolved more eagerly....

Best,
r




More information about the asdf-devel mailing list