On Wed Feb 13 14:08:29 2013, DOM wrote:
Show quoted text> As reported in the Debian BTS[1], the (apparently deliberate) failure
of
Show quoted text> various functions in XSUtil.pm to exit non-zero when no compiler is
found
Show quoted text> can cause problems, such as building an empty package.
>
> Whilst there are extra safeguards which could be added to the Debian
> build system in question (debhelper), could you clarify why this
choice
Show quoted text> was made, and if you would consider changing it?
(I later updated the Debian bug report to note that I don't think it is
appropriate to only guard against this in the Debian build system,
because that would not protect against using an out of date Makefile
which was left behind by a previous build).
I've attached a simple patch; please consider applying it.
Thanks,
Dominic.
Show quoted text
diff --git a/lib/Module/Install/XSUtil.pm b/lib/Module/Install/XSUtil.pm
index 93a5299..3e04caa 100644
--- a/lib/Module/Install/XSUtil.pm
+++ b/lib/Module/Install/XSUtil.pm
@@ -47,8 +47,7 @@ sub _xs_initialize{
$self->{xsu_initialized} = 1;
if(!$self->cc_available()){
- warn "This distribution requires a C compiler, but it's not available, stopped.\n";
- exit;
+ die "This distribution requires a C compiler, but it's not available, stopped.\n";
}
$self->configure_requires(%ConfigureRequires);
@@ -245,8 +244,7 @@ C99
sub requires_c99 {
my($self) = @_;
if(!$self->c99_available) {
- warn "This distribution requires a C99 compiler, but $Config{cc} seems not to support C99, stopped.\n";
- exit;
+ die "This distribution requires a C99 compiler, but $Config{cc} seems not to support C99, stopped.\n";
}
$self->_xs_initialize();
$UseC99 = 1;
@@ -256,8 +254,7 @@ sub requires_c99 {
sub requires_cplusplus {
my($self) = @_;
if(!$self->cc_available) {
- warn "This distribution requires a C++ compiler, but $Config{cc} seems not to support C++, stopped.\n";
- exit;
+ die "This distribution requires a C++ compiler, but $Config{cc} seems not to support C++, stopped.\n";
}
$self->_xs_initialize();
$UseCplusplus = 1;
@@ -343,8 +340,7 @@ sub cc_assert_lib {
}
if (! $loaded_lib) {
- warn "Devel::CheckLib not found in inc/ nor \@INC";
- exit 0;
+ die "Devel::CheckLib not found in inc/ nor \@INC";
}
$self->{xsu_loaded_checklib}++;
@@ -850,7 +846,7 @@ See L<XS::MRO::Compat> and L<Method::Cumulative> for example.
Returns true if a C compiler is available. YOU DO NOT NEED TO CALL
THIS FUNCTION YOURSELF: it will be called for you when this module is
-initialized, and your Makefile.PL process will exit with 0 status.
+initialized, and your Makefile.PL process will exit with non-zero status.
Only explicitly call if you need to do some esoteric handling when
no compiler is available (for example, when you have a pure perl alternative)