Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"

by jffry (Hermit)
on Dec 03, 2011 at 00:44 UTC ( [id://941466] : note . print w/replies, xml ) Need Help??


in reply to Re^2: Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"
in thread Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"

Here is that sub.

I can probably read perlre to figure out what ?: does, but a search of perlop for !! gives me nothing useful. Is that really two Boolean NOTs side-by-side? Can't be. So what is that operator? In any case, I'm guessing the real answer lies in the make method, and I'll pretend this sub makes sense even though I don't understand it now.

sub is_make_type { my($self, $type) = @_; return !! ($self->make =~ /\b$type(?:\.exe)?$/); }

I found the make method defined over in ExtUtils::MM_Any, which is required by MM_Win32.pm on line 27.

sub make { my $self = shift; my $make = lc $self->{MAKE}; # Truncate anything like foomake6 to just foomake. $make =~ s/^(\w+make).*/$1/; # Turn gnumake into gmake. $make =~ s/^gnu/g/; return $make; }

So self->{MAKE} is some kind of OOesque hash key lookup, right? Sorry, but I don't know Perl OO very well.

But where does that key get set? Since that is an access to private data in this class (I think), doesn't that particular MAKE hash key value have to get set within this package file? But I can't find it in MM_Any.pm. Well, I find plenty of "MAKE" strings being used to demarcate here-files, but that isn't helping my search.

Any ideas?

  • Comment on Re^3: Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"
  • Select or Download Code

Replies are listed 'Best First'.
Re^4: Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"
by Anonymous Monk on Dec 03, 2011 at 01:24 UTC

    Any ideas?

    Stop digging before you've ruled out the most simple things

    Step 1, step out of cpan, cpan>look Module and run perl Makefile.PL yourself, and confirm

    perl -V: <P>Confirm all paths, eg <C>perl -V:make -V:perlpath -e " die $^X

    Look inside Makefile for path to perl.exe

      I ran your command, and it looks okay to to me.

      C:\strawberry\cpan\build\OLE-Storage_Lite-0.19-pT5XuU > perl -V:make -V:perlpath -e " die $^X" make='dmake'; perlpath='C:\strawberry\perl\bin\perl.exe'; C:\strawberry\perl\bin\perl.exe at -e line 1.

      After the perl Makefile.PL command, I look in the Makefile and see:

      C:\strawberry\cpan\build\OLE-Storage_Lite-0.19-pT5XuU > find "perl.exe" Makefile ---------- MAKEFILE PERL = C:\strawberry\perl\bin\perl.exe FULLPERL = C:\strawberry\perl\bin\perl.exe perl.exe so_locations \ FULLPERL = C:\strawberry\perl\bin\perl.exe

      Any more suggestions?

        Any more suggestions?

        In my version of Strawberry, when I build IO-React-1.03, there's no problem.
        When I look at the generated Makefile I see:
        DIRFILESEP = \\ DFSEP = $(DIRFILESEP)
        Next I open up lib/ExtUtils/MM_Win32.pm and I find in it:
        sub init_DIRFILESEP { my($self) = shift; # The ^ makes sure its not interpreted as an escape in nmake $self->{DIRFILESEP} = $self->is_make_type('nmake') ? '^\\' : $self->is_make_type('dmake') ? '\\\\' : '\\'; }
        So I change the dmake setting (from 4 backslashes to 2) so that the sub now reads:
        sub init_DIRFILESEP { my($self) = shift; # The ^ makes sure its not interpreted as an escape in nmake $self->{DIRFILESEP} = $self->is_make_type('nmake') ? '^\\' : $self->is_make_type('dmake') ? '\\' : '\\'; }
        Now ... have another go at building IO-React-1.03 (having first run 'dmake realclean'):
        C:\sisyphusion\IO-React-1.03>perl makefile.PL Checking if your kit is complete... Looks good Writing Makefile for IO::React Writing MYMETA.yml and MYMETA.json C:\sisyphusion\IO-React-1.03>dmake dmake: Error: -- `C:\_32\strawberry514\perl\libConfig.pm' not found, +and can't be made
        Sure enough, when I look at the generated Makefile, I now find it's the same as yours wrt DIRFILESEP:
        DIRFILESEP = \ DFSEP = $(DIRFILESEP)
        Your generated Makefile is wrong ... plain and simple ... you need to remedy whatever it is that keeps generating this fucked Makefile.

        In the above MM_Win32.pm sub, does $self->is_make_type('dmake') return true for you ?
        In essence, you just need to modify that sub so that it returns \\\\ (4 backslashes) for you. Even if you just do it as:
        sub init_DIRFILESEP { return '\\\\'; }
        That should do it.

        Cheers,
        Rob
Re^4: Strawberry Perl 5.12.3, CPAN, make file problems (dmake.exe), DFSEP and backslash "\"
by Eliya (Vicar) on Dec 03, 2011 at 04:16 UTC
    But where does that key get set?

    There's init_MAKE(), which sets it (if it's not alredy set at this point) from the environment, or else from $Config{make} (which should be what you get via perl -V:make )

    sub init_MAKE { my $self = shift; $self->{MAKE} ||= $ENV{MAKE} || $Config{make}; }

    A couple of well-placed prints can answer many questions, e.g. allow you to check whether the value is what you'd expect, or something funky

    sub init_MAKE { my $self = shift; print STDERR ">>> before: '$self->{MAKE}'\n"; $self->{MAKE} ||= $ENV{MAKE} || $Config{make}; print STDERR ">>> after: '$self->{MAKE}'\n"; }

    (and if you don't get any print output at all, you'll at least know you're executing something else entirely...)

    P.S. For a discussion of !!, see Perl Idioms Explained - !!expr and Secret Perl Operators: the boolean list squash operator, x!! (and probably others) — if generally interested, it's not really relevant to the problem at hand.