develooper Front page | perl.inline | Postings from July 2014

[rt.cpan.org #85336] Fails often when tested in parallel

Thread Previous
From:
Sisyphus via RT
Date:
July 1, 2014 08:27
Subject:
[rt.cpan.org #85336] Fails often when tested in parallel
Message ID:
rt-4.0.18-1107-1404203257-1562.85336-15-0@rt.cpan.org
Tue Jul 01 04:27:36 2014: Request 85336 was acted upon.
Transaction: Correspondence added by SISYPHUS
       Queue: Inline
     Subject: Fails often when tested in parallel
   Broken in: 0.53
    Severity: (no value)
       Owner: Nobody
  Requestors: ANDK@cpan.org, KENTNL@cpan.org
      Status: resolved
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=85336 >


Re-opening because of the following patch that was applied to Inline-0.55 as part of this ticket:

####################################
Subject: [PATCH 4/5] MSWin32: disable BUILD_NOISY redirects on MSWin32 with
 cmd.exe

also print exitcode with failed commands

diff --git C/C.pm C/C.pm
index f76e34b..21f7dfe 100644
--- C/C.pm
+++ C/C.pm
@@ -804,6 +804,7 @@ sub makefile_pl {
     -f ($perl = $Config::Config{perlpath})
       or ($perl = $^X)
       or croak "Can't locate your perl binary";
+    $perl = qq{"$perl"} if $perl =~ m/\s/;
     $o->system_call("$perl Makefile.PL", 'out.Makefile_PL');
     $o->fix_make;
 }
@@ -841,6 +842,7 @@ sub system_call {
       defined $ENV{PERL_INLINE_BUILD_NOISY}
       ? $ENV{PERL_INLINE_BUILD_NOISY}
       : $o->{CONFIG}{BUILD_NOISY};
+    $build_noisy = undef if $build_noisy and $^O eq 'MSWin32' and $Config::Config{sh} =~ /^cmd/;
     if (not $build_noisy) {
         $cmd = "$cmd > $output_file 2>&1";
     }
@@ -861,11 +863,12 @@ sub build_error_message {
         close OUTPUT;
     }
 
+    my $errcode = $? >> 8;
     return $output . <<END;
 
 A problem was encountered while attempting to compile and install your Inline
 $o->{API}{language} code. The command that failed was:
-  $cmd
+  \"$cmd\" with error code $errcode
 
 The build directory was:
 $build_dir
####################################

I wondered at the time (and still wonder) what that was about - but I applied it anyway, as it didn't break any tests.

However, it does break BUILD_NOISY on Win32 - to the extent that the compiler/linker commands/warnings of a successful build are not seen.

simply removing the line:

    $build_noisy = undef if $build_noisy and $^O eq 'MSWin32' and $Config::Config{sh} =~ /^cmd/;

from the patched (0.55) C.pm is sufficient to regain correct functioning of BUILD_NOISY on Windows.
However, doing that probably also destroys whatever it was that the patch was designed to fix.

This episode exposes a need for a test script that examines the output of a BUILD_NOISY build to detect that this output is present.
It would be hard to check that the entire output is as it should be, but we should at least be able to check for the presence of certain key elements like  - eg that the output matches the string "perl", that it matches the (interpolated)"$Config{LD}" and that it matches the name of any Inline-C function whose compilation is expected to emit a warning.

I think this breakage of BUILD_NOISY needs to be fixed for the next stable release.

Attached is a try.pl that demonstrates the problem. It shows the expected output of the script, and the actual output I get on one of my Win32 perls using Inline-0.55.

Cheers,
Rob

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About