On Wednesday, April 24, 2002, at 06:22 AM, Michael G Schwern wrote:
> On Tue, Apr 23, 2002 at 07:19:25PM +1000, Ken Williams wrote:
>> I'm on OS X 10.1.4, perl 5.6.0, using the blead-Makemaker at the
>> time of this writing. I'm trying to compile mod_perl 1.26 with
>> apache 1.3.22.
>>
>> I used to be able to just do "perl Makefile.PL EVERYTHING=1".
>> However, now I get errors like the following (note the q{Can't
>> locate object method "catdir" via package "MY"}). Something
>> changed here?
>
> 5.6.1's ExtUtils::Embed is Very Chummy with MakeMaker and doing Evil
> Things
> like rolling it's own MY object and then expecting MY to exist by
> virtue of
> requiring ExtUtils::MakeMaker. MM is one thing. MY is just Wrong.
How is anybody supposed to know that? The docs give examples like this:
package MY; # so that "SUPER" works right
sub c_o {
my $inherited = shift->SUPER::c_o(@_);
$inherited =~ s/old text/new text/;
$inherited;
}
So one might reasonably expect that 'MY' is a valid subclass name that
will get you access to the MakeMaker methods.
> Without getting into detail, the proper solution is that ExtUtils::Embed
> will have to be upgraded along with ExtUtils::MakeMaker. Unfortunately,
> there is not yet a CPAN version of ExtUtils::Embed.
If so, it needs to be added to the PREREQ. Otherwise you'll unwittingly
break EU::Embed when you install EU::MM.
> Meantime, I can hack MakeMaker so that MY exists when
> ExtUtils::MakeMaker is
> loaded.
>
> Ken, try the snapshot.
Yeah, I was going to send you a patch with this same fix. Here are some
tests for it too.
-Ken
Index: t/MM_Unix.t
===================================================================
RCS file: /home/schwern/cvs/ExtUtils-MakeMaker/t/MM_Unix.t,v
retrieving revision 1.7
diff -u -r1.7 MM_Unix.t
--- t/MM_Unix.t 22 Apr 2002 02:27:22 -0000 1.7
+++ t/MM_Unix.t 24 Apr 2002 00:43:19 -0000
@@ -18,7 +18,7 @@
plan skip_all => 'Non-Unix platform';
}
else {
- plan tests => 112;
+ plan tests => 114;
}
}
@@ -249,3 +249,13 @@
is( $t->{CCFLAGS}, '-DMY_THING', 'cflags retains CCFLAGS' );
}
+# MY
+{
+ # Make sure MY is inheriting from MM_Unix or similar
+ ok( MY->can('fixin') );
+
+ # Test the deprecated MY->catdir, etc. These need to keep working
+ # indefinitely, or until a modern version of ExtUtils::Embed is a
dependency.
+ my $dir = eval {MY->catdir('foo','bar')};
+ is( $dir, File::Spec->catdir('foo','bar') );
+}