From ac18778d81ff8c30bc1beea543c6f3f72f3e0ac2 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Tue, 2 Jul 2019 10:54:56 -0600 Subject: [PATCH] devel/mktodo: Notify user of blead compilation issues The results will be off unless the very first time, things work. Prior to this commit that could go undetected. (cherry picked from commit 04103542d777e907b9775abf042e9a23dbed7812) Signed-off-by: Nicolas R --- dist/Devel-PPPort/devel/mktodo | 10 +++++++--- dist/Devel-PPPort/devel/mktodo.pl | 25 +++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/dist/Devel-PPPort/devel/mktodo b/dist/Devel-PPPort/devel/mktodo index 1cec427..e7014f0 100755 --- a/dist/Devel-PPPort/devel/mktodo +++ b/dist/Devel-PPPort/devel/mktodo @@ -41,16 +41,20 @@ if (exists $opt{'blead-version'}) { $perls[0]{version} = $opt{'blead-version'}; } +# blead's todo is its version plus 1. Otherwise, each todo is the previous +# one's version +$perls[0]{todo} = $perls[0]{version} + 1; for (1 .. $#perls) { $perls[$_]{todo} = $perls[$_-1]{version}; } -shift @perls; - for (@perls) { my $todo = do { my $v = $_->{todo}; $v =~ s/\D+//g; $v }; -e "$outdir/$todo" and next; - my @args = ('--perl', $_->{path}, '--todo', "$outdir/$todo", '--version', "$_->{todo}"); + my @args = ('--perl', $_->{path}, '--version', "$_->{todo}"); + + push @args, '--blead' if $_ == $perls[0]; # First one is blead + push @args, '--todo', $_->{'todo'}; push @args, '--base' if $opt{base}; push @args, '--verbose' if $opt{verbose}; push @args, '--nocheck' unless $opt{check}; diff --git a/dist/Devel-PPPort/devel/mktodo.pl b/dist/Devel-PPPort/devel/mktodo.pl index 6d87ffd..a57029a 100644 --- a/dist/Devel-PPPort/devel/mktodo.pl +++ b/dist/Devel-PPPort/devel/mktodo.pl @@ -25,15 +25,18 @@ use Time::HiRes qw( gettimeofday tv_interval ); require './devel/devtools.pl'; our %opt = ( + blead => 0, # ? Is this perl blead debug => 0, base => 0, verbose => 0, check => 1, + todo => "", # If no --todo, this is a blead perl, and the make should + # work without error shlib => 'blib/arch/auto/Devel/PPPort/PPPort.so', ); GetOptions(\%opt, qw( - perl=s todo=s version=s shlib=s debug base verbose check! +perl=s todo=s blead version=s shlib=s debug base verbose check! )) or die; identify(); @@ -70,7 +73,7 @@ for (`$Config{nm} $fullperl`) { } keys %sym >= 50 or die "less than 50 symbols found in $fullperl\n"; -my %all = %{load_todo($opt{todo}, $opt{version})}; +my %all = %{load_todo($opt{todo}, $opt{version})} if $opt{todo}; my @recheck; my $symmap = get_apicheck_symbol_map(); @@ -86,6 +89,24 @@ retry: my $r = run(qw(make)); $r->{didnotrun} and die "couldn't run make: $!\n"; + # 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 + # aren't working right. + if ($opt{blead} && $opt{base}) { + undef $opt{blead}; # Only warn once. + if (@{$r->{stderr}}) { + print STDERR "Warnings and errors from compiling blead:\n"; + print STDERR @{$r->{stderr}}; + ask_or_quit("\nUnexpected warnings when compiling blead can lead to" + . " wrong results. Please examine the above list.\n" + . "Shall I proceed?"); + } + else { + print STDERR "blead compiled without warnings nor errors.\n" + . "Proceeding with everything else\n"; + } + } + for my $l (@{$r->{stderr}}) { if ($l =~ /_DPPP_test_(\w+)/) { if (!$seen{$1}++) { -- 1.8.3.1