This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
devel/mktodo.pl: Add comments, dump stderr if error
authorKarl Williamson <khw@cpan.org>
Sat, 29 Jun 2019 06:32:21 +0000 (00:32 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:39:31 +0000 (16:39 -0600)
These are some rudimentary comments.  It started working before I had to
delve deeper.

(cherry picked from commit a70e4aafcde7761301e62b6f630d11da5788c61f)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/devel/mktodo.pl

index bf9b01a..d3aeab2 100644 (file)
@@ -30,8 +30,7 @@ our %opt = (
   base    => 0,
   verbose => 0,
   check   => 1,
-  todo    => "",    # If no --todo, this is a blead perl, and the make should
-                    # work without error
+  todo    => "",  # If no --todo, this is a blead perl
   shlib   => 'blib/arch/auto/Devel/PPPort/PPPort.so',
 );
 
@@ -87,7 +86,8 @@ retry:
   my(@new, @already_in_sym, %seen);
 
   my $r = run(qw(make));
-  $r->{didnotrun} and die "couldn't run make: $!\n";
+  $r->{didnotrun} and die "couldn't run make: $!\n" .
+        join('', @{$r->{stdout}})."\n---\n".join('', @{$r->{stderr}});
 
   # If there were warnings, we ask the user before continuing when creating
   # the base files of blead.  This leads to a potential early exit when things
@@ -133,7 +133,8 @@ retry:
 
     unless (@u) {
       $r = run(qw(make test));
-      $r->{didnotrun} and die "couldn't run make test: $!\n";
+      $r->{didnotrun} and die "couldn't run make test: $!\n" .
+        join('', @{$r->{stdout}})."\n---\n".join('', @{$r->{stderr}});
       $r->{status} == 0 and last;
 
       for my $l (@{$r->{stderr}}) {
@@ -212,7 +213,8 @@ if ($opt{check}) {
 
     my $r = run(qw(make test));
 
-    $r->{didnotrun} and die "couldn't run make test: $!\n";
+    $r->{didnotrun} and die "couldn't run make test: $!\n" .
+        join('', @{$r->{stdout}})."\n---\n".join('', @{$r->{stderr}});
 
     if ($r->{status} == 0) {
       display_sym('del', $sym, $cur);
@@ -251,8 +253,11 @@ sub regen_Makefile
 
   # just to be sure
   run(qw(make realclean));
-  run($fullperl, "Makefile.PL", @mf_arg)->{status} == 0
-      or die "cannot run Makefile.PL: $!\n";
+  my $r = run($fullperl, "Makefile.PL", @mf_arg);
+  unless ($r->{status} == 0) {
+      die "cannot run Makefile.PL: $!\n" .
+          join('', @{$r->{stdout}})."\n---\n".join('', @{$r->{stderr}});
+  }
 }
 
 sub regen_apicheck
@@ -330,7 +335,8 @@ sub read_sym
   my $r = run($Config{nm}, @{$opt{options}}, $opt{file});
 
   if ($r->{didnotrun} or $r->{status}) {
-    die "cannot run $Config{nm}";
+    die "cannot run $Config{nm}" .
+          join('', @{$r->{stdout}})."\n---\n".join('', @{$r->{stderr}});
   }
 
   my %sym;
@@ -351,10 +357,14 @@ sub get_apicheck_symbol_map
   my $r;
 
   while (1) {
+
+    # Create apicheck.i
     $r = run(qw(make apicheck.i));
 
+    # Quit the loop if it succeeded
     last unless $r->{didnotrun} or $r->{status};
 
+    # Get the list of macros that it failed on
     my %sym = map { /error: macro "(\w+)" (?:requires|passed) \d+ argument/ ? ($1 => 'A') : () }
               @{$r->{stderr}};
 
@@ -366,7 +376,7 @@ sub get_apicheck_symbol_map
       write_todo($opt{todo}, $opt{version}, \%todo);
       regen_apicheck();
     }
-    else {
+    else {  # It failed for some other reason: give up
       die "cannot run make apicheck.i ($r->{didnotrun} / $r->{status}):\n".
           join('', @{$r->{stdout}})."\n---\n".join('', @{$r->{stderr}});
     }