On Mon, 03 Mar 2008, David Golden wrote:
> On Mon, Mar 3, 2008 at 10:25 AM, Jan Dubois <[EMAIL PROTECTED]> wrote:
> >  However, I think using Devel::AssertOS is really overkill for this purpose.
> >  I just use the following code in most Win32::* modules:
> >
> >     unless ($^O eq "MSWin32" || $^O eq "cygwin") {
> >         die "OS unsupported\n";
> >     }
> >
> >  I'm not sure why using a module would be better for this simple use case.
> 
> Just for historical reference, the idea was to avoid having to explain
> the "OS unsupported" incantation to people each time and avoid them
> having to get it wrong.  The "use-devel-assertos" script is supposed
> to be "fire and forget" to hide the details.

I can see the value of the module if you need to check for more complicated
stuff, like Linux kernel versions or whatnot. But otherwise it still seems
more complicated than the simple 3 lines above.  Especially since you have
to modify META.yml as well as bundling additional code in inc.

And if I look at the actual call, I'm not sure I understand what is going
on:

    use Devel::AssertOS qw(MicrosoftWindows MSWin32 Cygwin);

So what is "MicrosoftWindows" doing there? It is not a valid $^O value.
I checked the module documentation, which says this is some kind of
shortcut for "MSWin32 Cygwin" (despite it being 2 characters longer), so
the remaining entries are redundant, no? And $^O on Cygwin is actually
"cygwin", so I wonder I the module did this right or not. Having the
simple test in Makefile.PL doesn't leave any doubt about what goes on
(and doesn't need additional META.yml fiddling).

Anyways, it is of course up to Cosimo to decide how he wants to do
this; I was just pointing out the problems...

> Of course, it really needs to do something about setting "no_index"
> for inc/.  I'll file a bug on RT (if there isn't one already).  At the
> least, it should warn liberally about it.  Setting no_index is
> relatively easy with Build.PL, but hard in ExtUtils::MakeMaker
> (die!die!die!).
> 
> For example, in Build.PL, just add arguments to new() like this:
> 
>     meta_add            => {
>         no_index => {
>             directory => [ qw/ examples inc t / ],
>         }
>     },

Chris has already converted Win32-IPC to use Module::Build.  I'll
look into it more closely once libwin32 is being released as individual
modules to see if the other should be moved there as well.

Cheers,
-Jan

Reply via email to