Skip to content
Browse files

protect against broken ExtUtils::Installed

git-svn-id: http://svn.perl.org/modules/Module-Build/trunk@13632 50811bd7-b8ce-0310-adc1-d9db26280581
  • Loading branch information...
1 parent 2e0c4ae commit d1643560ddd9ac45b419cbcd4db8990c2e76fcec @xdg xdg committed Dec 4, 2009
Showing with 18 additions and 2 deletions.
  1. +5 −1 Changes
  2. +9 −1 lib/Module/Build/Base.pm
  3. +4 −0 t/bundle_inc.t
View
6 Changes
@@ -1,6 +1,10 @@
Revision history for Perl extension Module::Build.
-0.35_12 -
+0.35_12 -
+
+ Bug fixes:
+
+ - Protect inc/ bundling tests against broken ExtUtils::Installed
0.35_11 - Thu Dec 3 11:07:44 EST 2009
View
10 lib/Module/Build/Base.pm
@@ -1279,7 +1279,15 @@ sub write_config {
return unless inc::latest->can('loaded_modules');
require ExtUtils::Installed;
# ExtUtils::Installed is buggy about finding additions to default @INC
- my $inst = ExtUtils::Installed->new(extra_libs => [@INC]);
+ my $inst = eval { ExtUtils::Installed->new(extra_libs => [@INC]) };
+ if ($@) {
+ $self->log_warn( << "EUI_ERROR" );
+Bundling in inc/ is disabled because ExtUtils::Installed could not
+create a list of your installed modules. Here is the error:
+$@
+EUI_ERROR
+ return;
+ }
my @bundle_list = map { [ $_, 0 ] } inc::latest->loaded_modules;
# XXX TODO: Need to get ordering of prerequisites correct so they are
View
4 t/bundle_inc.t
@@ -8,6 +8,7 @@ use Config;
use IO::File;
use File::Spec;
use ExtUtils::Packlist;
+use ExtUtils::Installed;
use File::Path;
# Ensure any Module::Build modules are loaded from correct directory
@@ -17,6 +18,9 @@ blib_load('Module::Build::ConfigData');
if ( $ENV{PERL_CORE} ) {
plan skip_all => 'bundle_inc tests will never succeed in PERL_CORE';
}
+elsif ( ! eval { ExtUtils::Installed->new(extra_libs => [@INC]) } ) {
+ plan skip_all => 'ExtUtils::Installed had problems with your system';
+}
elsif ( Module::Build::ConfigData->feature('inc_bundling_support') ) {
plan tests => 18;
} else {

0 comments on commit d164356

Please sign in to comment.
Something went wrong with that request. Please try again.