Skip Menu |

This queue is for tickets about the ExtUtils-MakeMaker CPAN distribution.

Report information
The Basics
Id: 24774
Status: resolved
Priority: 0/
Queue: ExtUtils-MakeMaker

People
Owner: Nobody in particular
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: PREREQ_FATAL not overridable on the commandline
Take as a test case TELS/math/bignum-0.19.tar.gz The author insists on using PREREQ_FATAL=>1 in his Makefile.PL. MakeMaker does not let me override this on the commandline. It commits suicide without even *reading* the commandline. The attached patch seems to dalay the fatal action and lets me override PREREQ_FATAL. But I do not know about side effects. At least it passes all tests, but I have not tried anything besides 'make test' in the MakeMaker distribution.
Subject: makemaker-prereq-fatal-overrideable.patch
--- /home/src/perl/repoperls/installed-perls/perl/p07FX0V/perl-5.8.0@30104/lib/5.9.5/ExtUtils/MakeMaker.pm~ 2007-02-03 09:06:59.000000000 +0100 +++ /home/src/perl/repoperls/installed-perls/perl/p07FX0V/perl-5.8.0@30104/lib/5.9.5/ExtUtils/MakeMaker.pm 2007-02-03 16:16:01.000000000 +0100 @@ -414,13 +414,6 @@ $self->{PREREQ_PM}->{$prereq} : 'unknown version' ; } } - if (%unsatisfied && $self->{PREREQ_FATAL}){ - my $failedprereqs = join ', ', map {"$_ $unsatisfied{$_}"} - keys %unsatisfied; - die qq{MakeMaker FATAL: prerequisites not found ($failedprereqs)\n - Please install these modules first and rerun 'perl Makefile.PL'.\n}; - } - if (defined $self->{CONFIGURE}) { if (ref $self->{CONFIGURE} eq 'CODE') { %configure_att = %{&{$self->{CONFIGURE}}}; @@ -490,6 +483,13 @@ } else { parse_args($self,split(' ', $ENV{PERL_MM_OPT} || ''),@ARGV); } + if (%unsatisfied && $self->{PREREQ_FATAL}){ + my $failedprereqs = join ', ', map {"$_ $unsatisfied{$_}"} + keys %unsatisfied; + die qq{MakeMaker FATAL: prerequisites not found ($failedprereqs)\n + Please install these modules first and rerun 'perl Makefile.PL'.\n}; + } + $self->{NAME} ||= $self->guess_name;
Alternatively, I would welcome to chainsaw this whole option without replacement. Authors who want to boycott constructive cooperation between the toolchain shall use die(), they will always know where to find it. And the users and integrators will have a much easier job in patching the die out of the Makefile.PL than with going through the extra loop of trying to argue against inadequate PREREQ_FATAL nihilism. Alternatively, I know I have tried to get this regression out of MakeMaker some 6 years ago, let me suggest we document this option as what it is. The following writeup was my desparate trial to justify its bare existence in extraordinary situations. (But I'm quite positive that within a year's time even this situation will be resolved cleanly.) Here it is: =item PREREQ_FATAL Bool. If this parameter is true, failing to have the required modules (or the right versions thereof) will be fatal. C<perl Makefile.PL> will C<die> instead of simply informing the user of the missing dependencies. This is strongly discouraged and should never be used lightly. Consider that the purpose of the C<Makefile.PL> within the whole CPAN toolchain is just to write a good C<Makefile> that enables the user to continue building this module. This also involves putting all the necessary information for this task into the appropriate places, like for example to put all prerequisite information into the Makefile, so that the next tools in the toolchain can take the required actions to install them. If you deliberately C<die> in a C<Makefile.PL>, you break the toolchain because C<ExtUtils::MakeMaker> cannot write a C<Makefile> and cannot inform other players about the status of your module. As a consequence the user will have to do things manually that would otherwise be done by tools like C<CPAN.pm> or C<CPANPLUS>. Note: see L<Test::Harness> for a shortcut for stopping tests early if you are missing dependencies and are afraid that users might use your module with an incomplete environment. Do I<not> use this parameter for simple requirements, which could be resolved at a later time. Simple requirements are usually optimally resolved by tools in the toolchain. But this can only work well if you let C<ExtUtils::MakeMaker> do its job but not if you force it to commit suicide. It is I<extremely> rare to have to use C<PREREQ_FATAL> at all. The only situation where it is appropriate is when you have dependencies that are indispensible to actually I<write> a Makefile. For example when you need a module that can parse a header file that can determine some dependencies that must be written to the Makefile. If such a module is missing, then you apparently are unable to write a Makefile. And only then you should use PREREQ_FATAL.
Thanks. This will be in 6.33.