Alberto Simões | 3 Feb 22:50
Picon
Favicon
Gravatar

Ending Build.PL if there are missing modules

Hello

Builder->new seems to check if all required modules are available. But 
if any fails, it continues to process the Build.PL file.

Is there any way to make it stop?

Thanks

Leon Timmermans | 4 Feb 00:22
Picon
Gravatar

Re: Ending Build.PL if there are missing modules

2012/2/3 Alberto Simões <albie <at> alfarrabio.di.uminho.pt>:
> Hello
>
> Builder->new seems to check if all required modules are available. But if
> any fails, it continues to process the Build.PL file.
>
> Is there any way to make it stop?
>
> Thanks

Hi Alberto,

You shouldn't make it stop. «perl Build.PL» does configuration, not
building. Hence build or runtime requirements are not required to be
satisfied. What you're observing is not an error in any way, but an
essential step in the process. It gives the install tool the chance to
tell the cpan client (or the end user, if he's installing by hand) the
opportunity what dependencies to install.

If there are any missing dependencies, you'll notice it soon enough
(in particular when doing «./Build test».

Leon

Adam Kennedy | 4 Feb 01:32
Picon

Re: Ending Build.PL if there are missing modules

While I agree it needs to finish, I do kind of wish dependencies could
be enforced at the build module level so that tests couldn't run until
dependencies are satisfied.

Adam

On 4 February 2012 10:22, Leon Timmermans <fawaka <at> gmail.com> wrote:
> 2012/2/3 Alberto Simões <albie <at> alfarrabio.di.uminho.pt>:
>> Hello
>>
>> Builder->new seems to check if all required modules are available. But if
>> any fails, it continues to process the Build.PL file.
>>
>> Is there any way to make it stop?
>>
>> Thanks
>
> Hi Alberto,
>
> You shouldn't make it stop. «perl Build.PL» does configuration, not
> building. Hence build or runtime requirements are not required to be
> satisfied. What you're observing is not an error in any way, but an
> essential step in the process. It gives the install tool the chance to
> tell the cpan client (or the end user, if he's installing by hand) the
> opportunity what dependencies to install.
>
> If there are any missing dependencies, you'll notice it soon enough
> (in particular when doing «./Build test».
>
> Leon
(Continue reading)

Michael G Schwern | 4 Feb 02:33
Picon
Favicon
Gravatar

Re: Ending Build.PL if there are missing modules

On 2012.2.3 3:22 PM, Leon Timmermans wrote:
> You shouldn't make it stop. «perl Build.PL» does configuration, not
> building. Hence build or runtime requirements are not required to be
> satisfied. What you're observing is not an error in any way, but an
> essential step in the process. It gives the install tool the chance to
> tell the cpan client (or the end user, if he's installing by hand) the
> opportunity what dependencies to install.

MakeMaker has something like what Alberto wants, PREREQ_FATAL.  It's
considered a misfeature for exactly the reasons above.  It doesn't let the
configuration step complete so tools cannot resolve the dependencies and
continue building.

Alberto, what are you trying to accomplish here?  There's probably a way to do it.

--

-- 
emacs -- THAT'S NO EDITOR... IT'S AN OPERATING SYSTEM!

Michael G Schwern | 4 Feb 03:29
Picon
Favicon
Gravatar

Re: Ending Build.PL if there are missing modules

On 2012.2.3 4:32 PM, Adam Kennedy wrote:
> While I agree it needs to finish, I do kind of wish dependencies could
> be enforced at the build module level so that tests couldn't run until
> dependencies are satisfied.

This should be enforced not by the build tool, which cannot resolve the
dependencies itself, but by the tool running the install.

And I mean both meanings of "tool". ;)

--

-- 
Whip me, beat me, make my code compatible with VMS!

Alberto Simões | 4 Feb 11:53
Picon
Favicon
Gravatar

Re: Ending Build.PL if there are missing modules

Hello

On 04/02/12 01:33, Michael G Schwern wrote:
> On 2012.2.3 3:22 PM, Leon Timmermans wrote:
>> You shouldn't make it stop. «perl Build.PL» does configuration, not
>> building. Hence build or runtime requirements are not required to be
>> satisfied. What you're observing is not an error in any way, but an
>> essential step in the process. It gives the install tool the chance to
>> tell the cpan client (or the end user, if he's installing by hand) the
>> opportunity what dependencies to install.
>
> MakeMaker has something like what Alberto wants, PREREQ_FATAL.  It's
> considered a misfeature for exactly the reasons above.  It doesn't let the
> configuration step complete so tools cannot resolve the dependencies and
> continue building.
>
> Alberto, what are you trying to accomplish here?  There's probably a way to do it.

Basically, I depend on Parse::Yapp, and I would like to call `yapp` on 
Build.PL so I can have the generated .pm file before M::B generates all 
its data dir.

In fact, I can add that to inc/MyBuilder.pm, but I am afraid the 
generated .pm will not be installed.

But probably I am just too used to MakeMaker and M::B will work just fine :)

Cheers
ambs

(Continue reading)

Leon Timmermans | 4 Feb 12:56
Picon
Gravatar

Re: Ending Build.PL if there are missing modules

2012/2/4 Alberto Simões <albie <at> alfarrabio.di.uminho.pt>:
> Basically, I depend on Parse::Yapp, and I would like to call `yapp` on
> Build.PL so I can have the generated .pm file before M::B generates all its
> data dir.
>
> In fact, I can add that to inc/MyBuilder.pm, but I am afraid the generated
> .pm will not be installed.
>
> But probably I am just too used to MakeMaker and M::B will work just fine :)

There are two ways to do this. You can do this early enough during
build, the PL_files feature would be the most obvious way.
Alternatively you can add Parse::Yapp to configure requires (no need
to add a check for that, it will die by itself if it's missing), but
that will crap out on legacy perls without having any obvious
advantages.

Leon

Leon Timmermans | 4 Feb 13:48
Picon
Gravatar

Re: Ending Build.PL if there are missing modules

On Sat, Feb 4, 2012 at 1:32 AM, Adam Kennedy
<adamkennedybackup <at> gmail.com> wrote:
> While I agree it needs to finish, I do kind of wish dependencies could
> be enforced at the build module level so that tests couldn't run until
> dependencies are satisfied.

I tend to agree with that. I've been writting Test::CheckDeps
(warning: very much a 0.001 release) to make it crap out as early as
possible during testing, but it could be even earlier.

Leon

David Golden | 4 Feb 14:31
Picon
Gravatar

Re: Ending Build.PL if there are missing modules

On Sat, Feb 4, 2012 at 7:48 AM, Leon Timmermans <fawaka <at> gmail.com> wrote:
> On Sat, Feb 4, 2012 at 1:32 AM, Adam Kennedy
> <adamkennedybackup <at> gmail.com> wrote:
>> While I agree it needs to finish, I do kind of wish dependencies could
>> be enforced at the build module level so that tests couldn't run until
>> dependencies are satisfied.
>
> I tend to agree with that. I've been writting Test::CheckDeps
> (warning: very much a 0.001 release) to make it crap out as early as
> possible during testing, but it could be even earlier.

Plenty of code has dependencies listed that aren't truly required and
tests will pass with lower versions.

The proper way to enforce dependencies is in a "use" statement:

  use Foo::Bar 1.23;

Not coincidentally, that's how Dist::Zilla detects dependencies,
ensuring that code and specified prereqs are actually in sync.

In my view, other tools are doing it wrong.

-- David

David Golden | 5 Feb 02:23
Picon
Gravatar

Re: Ending Build.PL if there are missing modules

On Sat, Feb 4, 2012 at 5:17 PM, Adam Kennedy <adam <at> ali.as> wrote:
> That's how Module::Install's requires_from does it too.
>
> I should look at zilla's code and see how it runs, might be worth
> aligning M:I and it's detection.

It uses Ricardo's Perl::PrereqScanner, which does a pretty sane job of
it (even detects base/parent and so on).  It has some extensions for
picking up Moose and POE prereqs and so on.

It doesn't help with optional, dynamic prereqs so those have to be
specified manually, but that's unavoidable I think.

David


Gmane