warnings appearing during 'make' invocation of pmc2c.pl

Bruce Gray bruce.gray at acm.org
Fri Apr 2 18:46:02 UTC 2010


On Apr 2, 2010, at 7:19 AM, James E Keenan wrote:

> I have started to observe some warnings appearing early in the  
> 'make' process:
--snip--
> /usr/local/bin/perl tools/build/pmc2c.pl --dump  src/pmc/default.pmc
> at /home/jimk/work/parrot/tools/build/../../lib/Parrot/Pmc2c/ 
> Dumper.pm line 54
--snip--
> sometime between r45132 (March 23) and r45159 (March 24).

Quick analysis:
1. Sub find_file() in Pmc2cMain.pm can be called with or without a  
second parameter: `$die_unless_found`.

2. file_find() has contains debugging code that is innocuous when  
$die_unless_found is set, but is inappropriate when $die_unless_found  
is not set.
This code comes from r20228 (tewk - [Pmc2c] Work complete, Merge from  
pmc2c branch).

3. Prior to r45138 (plobsing - merge no_pmc_install branch), every  
call to file_find() set $die_unless_found to true.

4. In r45138, two calls to file_find were added without  
$die_unless_found being set.
The additions look appropriate, as do the absence of  
$die_unless_found, but this caused the debugging code to trigger in  
its inappropriate usage for the first time.


This patch should keep the same behavior when when $die_unless_found  
is set,
while suppressing the output when when $die_unless_found is not set.
The patch is not fully tested, and my analysis might be incomplete,
but that is all the time I have this weekend.

Tested with:
	$ rm src/pmc/default.dump
	$ perl tools/build/pmc2c.pl --dump src/pmc/default.pmc


Index: lib/Parrot/Pmc2c/Pmc2cMain.pm
===================================================================
--- lib/Parrot/Pmc2c/Pmc2cMain.pm	(revision 45384)
+++ lib/Parrot/Pmc2c/Pmc2cMain.pm	(working copy)
@@ -240,8 +240,11 @@
          return $path if -e $path;
      }

-    print Carp::longmess;
-    die "cannot find file '$file' in path '", join( "', '",  
@includes ), "'" if $die_unless_found;
+    if ($die_unless_found) {
+        my $includes_list = join "', '", @includes;
+        Carp::confess("cannot find file '$file' in path  
'$includes_list'");
+    }
+
      return;
  }

-- 
Hope this helps,
Bruce Gray


More information about the parrot-dev mailing list