cons-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Signature configurability


From: Steven Knight
Subject: Re: Signature configurability
Date: Fri, 23 Feb 2001 12:42:30 -0600 (CST)

On Fri, 23 Feb 2001, Brad Garcia wrote:
> > The question is, "What should the interface be?"
> 
> I like your solution.  It appears to be very easy to use.
> 
> I am wondering if it would be better to specify this within
> the environment.  Maybe someone uses two different C compilers
> for different parts of the build.

I'm glad you mentioned this.  I was originally heading towards
having it be part of the environment, but I backed off
because I thought that in the case of:

        Program $env 'foo', 'foo.c';

it was too restrictive that the environment's signature calculation
would get associated with *both* 'foo' and 'foo.o'.  So I backed off to
a global Signatuture method and *then* thought about adding the pattern
matching that would have solved the problem in the first place.

But now that you mention it, we do have to accomodate tool differences
through the environment.  So how about the following:

        $env = new cons( SIGNATURE => [
                                '*.o' => 'consign:content',
                                '*' => 'consign:build',
                        ] );

Note that it's an array ref ([]), not a hash ref ({}), because you have
to preserve the order of the patterns for evaluation (something I forgot
in my previous message's example).

> > Note that, as I currently envision it, this would be for derived-file
> > signature calculation only.  There's actually a parallel issue with
> > source files, which currently have their content re-calculated each time
> > even though there might be a usable signature in the .consign file.  It
> > might be worthwhile to have source file signatures be configurable as
> > well, but I don't have a good user interface in mind.
> 
> Strawman:
> 
> How about SourceSignature?
> 
>     SourceSignature '*' => qw(content);
> 
> would give current behavior, while
> 
>     SourceSignature '*' => qw(consign content);
> 
> would be the only other useful option, I would imagine.

That works for me.  This would presumably stay a top-level method
because source files don't have an environment that builds them.

        --SK




reply via email to

[Prev in Thread] Current Thread [Next in Thread]