Stop getting windows cpan fail reports
I’ve noticed I’ve been getting more fail reports from CPAN on some basic modules.
Things like File::PathInfo and LEOCHARRE::CLI, things I clearly intended for POSIX only portability. You see- most of these fail reports are from mswin32 platforms. M$ land.
I have zero interest in porting anything to windows. I resent that perl was ported.. or whatever did happen.. to m$ platforms.
I have gone back and made sure to place some hacks to stop my modules from even intalling on mswin32 platforms.
I asked some questions on perlmons.org for this also.
How to solve the issue of operating system incompatibilities with your perl modules..
I guess what we really want here, as a developer- is to stop getting fail reports from testing on an os you don’t intend on suporting.
I tried out Dev::AssertOS, which is cute. It creates an inc dir on your package, and places some code there. It also places some lines in your Makefile.PL and your MANIFEST.
This is alright.
The main way to solve non-perl dependency issues is to do it in the Makefile.PL
A typical Makefile.PL:
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'FileArchiveIndexer',
VERSION_FROM => 'lib/FileArchiveIndexer.pm',
PREREQ_PM => {
Cwd => 0,
},
);
Ok. What we want is that before you run the tests even… you stop dead cold if something is not met. Like, wrong os, or missing binary (some non-perl package not installed etc).
So here is one very hacky way to stop perl modules from reporting cpan testing fails, when run on an unsupported OS..
if( $^O=~/mswin32/i ){ die("Unsupported OS."); }
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'FileArchiveIndexer',
VERSION_FROM => 'lib/FileArchiveIndexer.pm',
PREREQ_PM => {
Cwd => 0,
},
);
Make super duper sure that your documentation does state that you do not support a certain operating system before you run wild with this. Don’t be a jackass. Just be.. assertive.