cons-discuss
[Top][All Lists]
Advanced

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

Re: not rebuilding out-of-date derived^2 objects


From: rick . croote
Subject: Re: not rebuilding out-of-date derived^2 objects
Date: Mon, 19 Apr 2004 17:45:42 -0500


Alan,

You are fighting it.  First, from a high level, you will be ahead of the game if you treat each Conscript as if it were a "Project" file.  Best to use one project, ie lib or executable, per Conscript.  Not the law, but just easier to maintain.  Further, it does not make sense to have source in a different Conscript from the "Project file", so is your lib is built in the same conscript as the source that goes into it you will be way ahead.

We have been using Cons very successfully.  Our current Cons build, builds some 8000 source files with over 500 projects.   And it does so very quickly and reliably.   We use ONE Construct file, of which I use to read one Construct.XML file that together manages all system wide tools and their options.  All options in the individual Conscripts are treated as overrides and should be justified.

In a previous email, I recommended the use of Conscript_chdir, and I still advocate that your life will be easier if you add it to your Construct, to that end, my further examples will assume you have done so.

Add prior to creating an instance of cons:
Conscript_chdir 1;

Now for the hard part, you delete you lib\Conscript file and change your src\Conscript to read as:

#!/usr/bin/perl -w

Import qw(env);

my @infiles = qw(
        foo.cpp
        );

$env->Library('#lib/libfoo', @infiles);

You should now note that changing your foo.h file rebuilds all necessary components.

Now, as for what was wrong with your setup.   Technically, nothing, it is a bug in Cons I reported long ago that prevents the signatures from properly propagating when using the Command function.   Add the following to the bottom of your Construct file and it should fix it.

package file;

sub sigtype {
    my $self = shift;
   
    #
    # If there is already a sigtype, this function is going to do nothing other
    # than exit with the sigtype already assigned.  This is the same as the
    # original method.
    #
    unless ($self->{sigtype})
    {
        #
        # New functionality.
        # If there is already a signature, set the $sigtype to the type of
        # signature found.
        #
        foreach (qw(bsig csig))
        {
            if ($self->{$_})
            {
                $self->{sigtype} = $_;
                last;
            }
        }
    }
   
    unless ($self->{sigtype})
    {
        #
        # Set the $sigtype to a build signature, if that type is found in the
        # sigarray.  DON'T ask me why!!!
        #
        $self->{sigtype} = 'bsig' if grep {$_ eq "build"} $self->sigarray;
    }
   
    #
    # New functionality.
    # Default to a content signature.
    #    
    $self->{sigtype} ||= 'csig';
}











"Alan Grow" <address@hidden>

Sent by:
address@hidden

04/17/2004 05:43 PM

       
        To:        address@hidden
        cc:        (bcc: Rick Croote/ATL-BTL/MS/PHILIPS)
        Subject:        not rebuilding out-of-date derived^2 objects

        Classification:        




Hi,

 Cons 2.3.0 isn't rebuilding "derived derived objects" correctly for me.
I've attached a tarball you can use to reproduce the behavior, but here's
what's going on...

 I am building libfoo.a from foo.o, which is built from foo.h and foo.cpp
in turn. The first time I cons, everything is rebuilt. Then if I add a new
function (say) to foo.h and cons again. This time foo.o is rebuilt but
libfoo.a is not, even though foo.o's contents have changed.

 I have left SourceSignature and SIGNATURE alone so they should be
defaulting to 'build', but it doesn't seem to matter. Also I am using two
Conscript files, one for the object file and one for the lib, because this
mimics the situation I first encountered the problem in. Anyway untar and
have a look for yourself.

 Am I using cons in a way that wasn't intended? Any ideas?

 -Alan

_________________________________________________________________
Get rid of annoying pop-up ads with the new MSN Toolbar – FREE!
http://toolbar.msn.com/go/onm00200414ave/direct/01/
_______________________________________________
address@hidden
http://mail.gnu.org/mailman/listinfo/cons-discuss
Cons URL: http://www.dsmit.com/cons/


Attachment: derivedtest.tar.gz
Description: Binary data


reply via email to

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