cons-discuss
[Top][All Lists]
Advanced

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

Re: out-of-date derived Repository files


From: Steven Knight
Subject: Re: out-of-date derived Repository files
Date: Wed, 29 Nov 2000 21:32:37 -0600 (CST)

On Wed, 29 Nov 2000, David Sanderson wrote:
> Cons 2.2.0 does not appear to check that derived files in a Repository
> are up to date.

Aha!  You're right, it doesn't.

> Say we have a source tree, c1, for a library, and a separate source
> tree, c2, for a program that uses that library.  Let us further suppose
> that c2 employs c1 as a Repository.  Here are two scenarios for using
> this setup.  The first proceeds as expected, but the second does not.
> 
> 1) If c1 contains no derived files and we descend into c2 and run cons,
>    everything is fine.  Cons builds all the c1 and c2 stuff under c2.
>    Moreover, if we then go and change the sources in c1, cons will
>    rebuild things correctly in c2.
> 
> 2) If we first build in c1, then build in c2, cons builds c2 using the
>    derived files from c1.  But if we then go and change the sources
>    in c1 (without rebuilding in c1) and then go to c2 and ask for a
>    rebuild, cons says that everything is up to date, even though it is
>    not.
> 
>    Is this behavior intentional?

Not really.

The repository code essentially assumes that the repository is up-to-date
by definition, either because it contains only source files, or because
it contains the results of a build that generated all up-to-date
derived files.  The scenario you describe, where a repository source
file has been changed but a build hasn't been done, just wasn't part of
the original repository design.

>    It seems to me that cons should check whether the derived files in
>    the repository are current, and if they are not it should proceed as
>    in (1) and build them locally.

I agree, this would be much more intuitive, and in the spirit of having
Cons always do the right thing.

>    Is there a way to make cons do this?

Not right now.  Another change for the TODO list, though.

> I've appended some code to illustrate these examples.  You will probably
> have to adjust CC and PATH in the two Construct files to make things
> work.  The 'test1' script corresponds to (1) above, and the 'test2'
> script corresponds to (2) above.

Many thanks for the test cases; they're a great help.

        --SK




reply via email to

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