cons-discuss
[Top][All Lists]
Advanced

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

Re: Cons 2.3.0 bug?


From: Steven Knight
Subject: Re: Cons 2.3.0 bug?
Date: Mon, 30 Jul 2001 17:39:20 -0500 (CDT)

On Mon, 30 Jul 2001, Gary Oberbrunner wrote:
> I seem to have discovered a bug in Cons in multi-target commands.
> I've enclosed a Construct which works properly the first time, but if you
> change 'hello' to 'goodbye' in the Conscript it rebuilds a.c, b.h, and c.h,
> but then stops -- it doesn't rebuild a.exe.
>
> The way this script is SUPPOSED to work is that the first Command generates
> a script foo.bat, which, when run, will generate some source code.  The
> second Command uses foo.bat to generate a.c, and also does some other stuff.
> This is the Command with the bug.  The final Program uses the generated a.c
> to make a (or a.exe on Win32).
>
> To repro: run the Construct, then change 'hello' to 'goodbye' and re-run it.
> It'll re-generate a.c, but won't rebuild a (or a.exe).
>
> I've enclosed two versions of the Construct, one for Win32, and one for
> Unix.  It behaves the same on either platform, I just want to make it easy
> to repro.
>
> Any hints on why this is happening?  It seems to happen whenever the target
> is an array reference, whether or not there's a second item in the array.
> I'm stumped.

I'm pretty sure this is because the environment isn't getting propagated
through the build::multiple package that handles array references.  This
used to not be necessary, but now it's needed so that Cons can consult
the SIGNATURE value in the environment to decide what signature to use
to determine if the target is out of date.

I've appended a patch below.  If this doesn't fix it, there's some other
problem at work, so speak up again.  (The patch is from already-checked
in source; Rajesh, any idea when you'll have time to release 2.3.1 so
these fixes are readily available?)

        --SK



Index: src/cons.pl
===================================================================
RCS file: /home/cvs/cons/src/cons.pl,v
retrieving revision 1.162
retrieving revision 1.163
diff -c -r1.162 -r1.163
*** src/cons.pl 2001/06/11 03:58:44     1.162
--- src/cons.pl 2001/06/15 20:20:27     1.163
***************
*** 15,21 ****

  use vars qw( $CVS_id $CVS_ver $ver_num $ver_rev $version );

! $CVS_id = '$Id: cons.pl,v 1.162 2001/06/11 03:58:44 knight Exp $ ';
  $CVS_ver = (split(/\s+/, $CVS_id))[2];

  $ver_num = "__VERSION__";
--- 15,21 ----

  use vars qw( $CVS_id $CVS_ver $ver_num $ver_rev $version );

! $CVS_id = '$Id: cons.pl,v 1.163 2001/06/15 20:20:27 knight Exp $ ';
  $CVS_ver = (split(/\s+/, $CVS_id))[2];

  $ver_num = "__VERSION__";
***************
*** 1667,1673 ****

  sub new {
      my($class, $builder, $tgts) = @_;
!     bless { 'builder' => $builder, 'tgts' => $tgts };
  }

  sub scriptsig {
--- 1667,1673 ----

  sub new {
      my($class, $builder, $tgts) = @_;
!     bless { 'builder' => $builder, 'env' => $builder->{env}, 'tgts' => $tgts 
};
  }

  sub scriptsig {





reply via email to

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