On 4/13/05, Michael G Schwern <[EMAIL PROTECTED]> wrote:
> On Wed, Apr 13, 2005 at 09:21:48AM +0100, Steve Hay wrote:
> > Michael G Schwern wrote:
> >
> > >http://www.pobox.com/~schwern/src/ExtUtils-MakeMaker-6.28.tar.gz
> > >
> > Any ideas how to fix the current problems in bleadperl on Win32?:
> > http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2005-04/msg00216.html
> >
> > The problems seem to have crept in in version 6.25_07:  If I manually
> > run the basic.t and installbase.t tests in that version in a command
> > prompt that doesn't have my perl "bin" directory on the PATH then both
> > tests fail in the same way as is happening in bleadperl.  The same two
> > tests run in the same way work OK in version 6.25_06.
> 
> The pl2bat problem is the result of this:
> 
>    $self->{FIXIN}    ||= $self->{PERL_CORE} ?
>      '$(PERLRUN) ../../win32/bin/pl2bat.pl' :
>      'pl2bat.bat';
> 
> Which assumes that things are being run from exactly two levels below the
> perl source directory such as ext/Foo/.  This hard coded assumption had
> not shown up before because prior to 6.25_07 there were not tests which
> involved executables.  Now there is.

I looked into this and the line in question doesnt seem to be directly
at fault, as the times where the error occurs $self->{PERL_CORE} is
set to 0 despite $ENV{PERL_CORE} being set to 1. I figured out how to
fix that, and then the error you meant popped up. The attached patch
resolves the issue with a hack that works fine for win32 but might
cause problems with winCE.

> So pl2bat needs to be modularized, something which should have happened
> a long time ago anyway.  Nothing fancy, just something along the lines
> of Pod::Html would be fine... a functional version of the command line
> interface.  It could live, for now, in ExtUtils::Command::MM and if
> someone wants to turn it into a real, public module they're welcome to.
> 

Theres a minor issue that the /wince branch has its own copy.

-- 
perl -Mre=debug -e "/just|another|perl|hacker/"
diff -ur cblead\lib\ExtUtils/MM_Unix.pm blead\lib\ExtUtils/MM_Unix.pm
--- cblead\lib\ExtUtils/MM_Unix.pm      2005-04-07 10:36:27.000000000 +0200
+++ blead\lib\ExtUtils/MM_Unix.pm       2005-04-17 18:12:43.093750000 +0200
@@ -1921,7 +1921,7 @@
     }
 
     # Are we building the core?
-    $self->{PERL_CORE} = 0 unless exists $self->{PERL_CORE};
+    $self->{PERL_CORE} = $ENV{PERL_CORE} unless exists $self->{PERL_CORE};
 
     # How do we run perl?
     foreach my $perl (qw(PERL FULLPERL ABSPERL)) {
diff -ur cblead\lib\ExtUtils/MM_Win32.pm blead\lib\ExtUtils/MM_Win32.pm
--- cblead\lib\ExtUtils/MM_Win32.pm     2005-04-07 10:36:27.000000000 +0200
+++ blead\lib\ExtUtils/MM_Win32.pm      2005-04-17 21:26:08.984375000 +0200
@@ -167,10 +167,18 @@
     $self->{TEST_F}   ||= '$(ABSPERLRUN) -MExtUtils::Command -e test_f';
     $self->{DEV_NULL} ||= '> NUL';
 
-    $self->{FIXIN}    ||= $self->{PERL_CORE} ? 
-      '$(PERLRUN) ../../win32/bin/pl2bat.pl' : 
-      'pl2bat.bat';
-
+    if ($self->{PERL_CORE}) {
+        my $file=$^X;
+        unless ($file=~s!perl\.exe!win32/bin/pl2bat.pl!i and -e $file ) {
+            require Cwd;
+            require Carp;
+            Carp::croak "Can't find pl2bat! cwd:",Cwd::cwd(),"\texe:\t$^X";
+        }
+        $self->{FIXIN} ||= '$(PERLRUN) '.$file;
+    } else {
+        $self->{FIXIN} ||= 'pl2bat.bat';
+    }
+    
     $self->{LD}     ||= $Config{ld} || 'link';
     $self->{AR}     ||= $Config{ar} || 'lib';
 

Reply via email to