Subject: | [PATCH] PREREQ output may be garbled if modules defined $SIG{__WARN__} |
The actual bug report against Test::NoWarnings can be found here
http://rt.cpan.org/Ticket/Display.html?id=41521
In short words, Test::NoWarnings defines $SIG{__WARN__} outside any
function. So a "require Test::NoWarnings" (an equivalent is done in the
prereq check in ExtUtils::MakeMaker::new) would change the behaviour of
warn(). In this case, all subsequent missing prerequisites wouldn't be
printed anymore.
The attached patch fixes this by localizing $SIG{__WARN__}. While being
there, I also localized $SIG{__DIE__} (this is a good habit I learned
from NI-S' source code).
Regards,
Slaven
Subject: | ExtUtils-MakeMaker-testnowarnings.patch |
commit 4b1fd5bc2933105fe5d1f162aa72c13c72e4face
Author: Slaven Rezic <slaven@rezic.de>
Date: Tue Dec 9 22:26:57 2008 +0100
* protect from modules which redefine $SIG{__WARN__} in toplevel
(http://rt.cpan.org/Ticket/Display.html?id=41521)
diff --git a/lib/ExtUtils/MakeMaker.pm b/lib/ExtUtils/MakeMaker.pm
index 314c5d0..4e1e781 100644
--- a/lib/ExtUtils/MakeMaker.pm
+++ b/lib/ExtUtils/MakeMaker.pm
@@ -446,7 +446,7 @@ END
# extra statement is a workaround.
my $file = "$prereq.pm";
$file =~ s{::}{/}g;
- eval { require $file };
+ eval { local $SIG{__WARN__}; local $SIG{__DIE__}; require $file };
my $pr_version = $prereq->VERSION || 0;