Skip Menu |

This queue is for tickets about the Module-Build CPAN distribution.

Report information
The Basics
Id: 72254
Status: open
Priority: 0/
Queue: Module-Build

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

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



Subject: Missing deps should have a non-zero exit status
When I use Makefile.PL, I rely on this: perl Makefile.PL && make && make test In writing up an example for basic Module::Build usage, I did the same thing: perl Build.PL && ./Build && ./Build test However, when I tried to build Weather::Google which lists a dependency on XML::Simple, it correctly reported that XML::Simple was not installed, but it went on to run (and fail) all of the tests. ./Build should return a non-zero status to ensure that the && ./Build test does not run. Cheers, Ovid
I agree.
I think a non-zero exit status will convince CPAN clients to abort, which means they won't then attempt to resolve prerequisites. Historically, missing prereqs were advisory -- as many modules might still work with version X even when the prerequisite was listed as Y (>X). Thus, a failure due to a prerequisite would manifest during an actual test, not during Build.PL. I would be willing to see a non-zero exit *only* for Perl 5.10.1 or greater and only when we don't have the magic PERL_CPAN_IS_RUNNING (or PERL_CPANPLUS_IS_RUNNING) or whatever the actual magic environment variables are. (Off the top of my head, I think CPAN/CPANPLUS as of 5.10.1 both set the variables correctly, which is why I would set that minimum.) I don't have time to check the exact behaviors of the clients, but I hope that gives the general parameters for what a solution would involve. -- David
Subject: Re: [rt.cpan.org #72254] Missing deps should have a non-zero exit status
Date: Mon, 07 Nov 2011 11:51:44 -0800
To: bug-Module-Build [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Sorry, my +1 was hasty. This doesn't work and AFAIK never did: perl Makefile.PL && make && make test The Makefile.PL does not exit with non-zero on prereq failure nor does make. It runs through to the test. In isolation it would be nice if they did exit non-zero, I agree with David that the behaviors of the CPAN clients will probably be affected.
On Mon Nov 07 14:26:20 2011, DAGOLDEN wrote: Show quoted text
> I think a non-zero exit status will convince CPAN clients to abort, > which means they won't then attempt to resolve prerequisites.
Well, he's suggesting to return non-zero during build, not configuration, so the CPAN client should have already installed the requirements by then. I'm not seeing a problem there. Show quoted text
> Historically, missing prereqs were advisory -- as many modules might > still work with version X even when the prerequisite was listed as Y > (>X). Thus, a failure due to a prerequisite would manifest during an > actual test, not during Build.PL.
The documentation has warned the users since 2002 (version 0.06) that it may do hard require. I'd say that's more than enough warning. Leon
Subject: Re: [rt.cpan.org #72254] Missing deps should have a non-zero exit status
Date: Mon, 7 Nov 2011 19:52:39 -0500
To: bug-Module-Build [...] rt.cpan.org
From: David Golden <dagolden [...] cpan.org>
On Mon, Nov 7, 2011 at 7:41 PM, Leon Timmermans via RT <bug-Module-Build@rt.cpan.org> wrote: Show quoted text
> Well, he's suggesting to return non-zero during build, not > configuration, so the CPAN client should have already installed the > requirements by then. I'm not seeing a problem there.
I missed that detail, but I would disagree with it. "make/Build" has nothing to do conceptually with prerequisites so I wouldn't use it for a general check of that sort. I could imagine a "hard prereqs" mode where "make/Build" fails if build_requires are missing and likewise a failure of "make test/Build test" if test_requires are missing (which begs the question of what to do with "runtime_requires", aka, plain old "requires"). Ultimately, I think that's just messy. The right place to fail is at configuration time during Makefile.PL/Build.PL and only under a flag that enables that (e.g. something like PREREQ_FATAL for EU::MM, perhaps call it "--prereq_fatal" for M::B) or else "automagically" under the rules I laid out where it is safe to do so without screwing up CPAN clients. -- David