Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: ExtUtils::MakeMaker : delcare a binary dependency

by Discipulus (Canon)
on Aug 29, 2023 at 10:19 UTC ( [id://11154109] : note . print w/replies, xml ) Need Help??


in reply to ExtUtils::MakeMaker : delcare a binary dependency

Hello bliako,

I second what tobyink said: use die and BAIL_OUT as soon as needed.

I asked very similar question when I received just red failurs from (very old win32) smokers CPAN tester machines.

My Win32::Backup::Robocopy needs:

1) to just run on win32 systems
2) to have a robocopy.exe available, so..

..in the Makefile.PL both check are done and they use die to exit direclty the building phase.

3) the module also needs a valid and not bugged version of the executable, so in 00-robocopycheck.t I re-test both the persence and the validity of the executable (with the check_robocopy_version method provided by the /t/bkpscenario.pm module).

With the above now the module tester matrix is just full of unknown instead of failures. But the output is both useful for the tester or casual user and for me too:

# Linux output: Output from '/home/perluser/perl5/perlbrew/perls/perl-5.34.1/bin/perl +Makefile.PL': OS linux unsupported! at Makefile.PL line 9. BEGIN failed--compilation aborted at Makefile.PL line 11. # oldish win32 output: Output from 'C:\Strawberry\perl\bin\perl.exe Makefile.PL': robocopy.exe not found! (you can set environment variable PERL_ROBOCO +PY_EXE to a custom path) at Makefile.PL line 40. BEGIN failed--compilation aborted at Makefile.PL line 55.

..and no one reached the test phase, but if this happens and there is an invalid version of the needed executable we will both know, me and the user.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.