cons-discuss
[Top][All Lists]
Advanced

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

Re: Please comment: Brave GNU World questionaire


From: Bob Sidebotham
Subject: Re: Please comment: Brave GNU World questionaire
Date: Tue, 29 Jan 2002 09:30:50 -0800 (PST)

--- Erich Waelde <address@hidden> wrote:
> I posted this earlier, but have not received anything

>    Then make will not derive util.o, because it's timestamp is newer
>    than that of util.c. However, make will attempt to derive the
>    executable util from the garbage file. :-( In make you get arround
>    this only with deleting the garbage file, or a ``make clean'' if
>    you cannot locate the error.
> 
>    Cons is much smarter in this case, it will create checksums of all
>    three files, compare those to stored ones and find that the
>    contents of util.o has changed as well as the date. It will
>    recreate util.o from util.c as expected, calculate the new
> checksum
>    for the derived file. Then it finds that the new checksum is
>    identical to the stored checksum and it will *not* recreate the
>    executable. Cons has found that the ingredients to util have not
>    really changed, despite recreating util.o.

This is slightly inaccurate: Cons *may* do what you've described,
depending upon the signature calculation method in use. By default,
however, it doesn't: on some systems, the object file contents can
change every time it is built (e.g. the compiler inserts a timestamp
into the object file) and so the actual contents are not considered.
Cons instead computes a "build signature" for the file and associates
it with that particular version of the file (using the timestamp as a
version string). If the build signature changes OR the version doesn't
match (because someone has altered the object file, for example), then
it is rebuilt. In practice, it works out to almost the same thing
because it does compute checksums by default of all the files in the
build that are likely to change, that is all the inputs to the build,
and checksums from dependent files are used to calculate the ultimate
build signature of each derived file. In recent versions of cons all of
this is now configurable.

> 
>    IMHO this is the beautiful side of Cons: Cons tries to do the
> right
>    thing, no more, no less. A very nice introduction to Cons can be
>    found in ``The Perl Journal'' issue #9, Spring 1998 (see below)
> 

In my opinion, the other piece that is attractive is the automatic
build sequencing. Most make-based systems have contrived and difficult
layers of complexity for achieving this.

I was just told that the original Cons article will appear in a new
O'Reilly book edited by Jon Orwant, "Computer Science and Perl
Programming: Best of The Perl Journal", ISBN:  0596003102. It should be
released in May. I'm allowed to make some changes, but he's only given
me a few days notice, so it won't change much. In any event, you can
include a pointer to the book if you wish.

Bob



__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com



reply via email to

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