Skip Menu |

This queue is for tickets about the Class-Prototyped CPAN distribution.

Report information
The Basics
Id: 31556
Status: resolved
Priority: 0/
Queue: Class-Prototyped

People
Owner: TEVERETT [...] cpan.org
Requestors: ANDK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.10
Fixed in: 1.11



Subject: Doesn't work with 5.10
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2007-12/msg00308.html The posting describes that patch 30980 to bleadperl broke Class::Prototyped.
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #31556] Doesn't work with 5.10
Date: Sat, 15 Dec 2007 11:59:10 -0900
To: Andreas Koenig via RT <bug-Class-Prototyped [...] rt.cpan.org>, perl5-porters [...] perl.org
From: Toby Ovod-Everett <toby [...] ovod-everett.org>
Sorry I've been playing an ostrich for a while - sort of hoping the bug would break something else and I wouldn't have to subject my poor skull to the pain of poking back into Class::Prototyped. Luckily, it didn't take me very long to find a workaround. I can fix Class::Prototyped (at least it passes the whole test suite) with a single line: @@ -1120,6 +1120,7 @@ #Defends against ISA caching problems no strict 'refs'; delete ${"$package\::"}{'::ISA::CACHE::'}; + @$isa = @$isa; } splice(@$parentOrder, $splice_point, 0, $slotName); } It didn't take me long to come up with that line because we (Ned Konz and I) had this problem in the past and we fixed it using this approach at that time. The problem is that using splice to modify @ISA (in this case, $isa is an alias) doesn't work properly. I know this was a problem in the past - I have a vague recollection of being in Vancouver for the Folk Music Festival in 2001 (I think it was 2001) and meeting up with the folks from ActiveState and mentioning to Gurusamy that we had to hack around the using splice with @ISA, and he replied that it was probably a bug. I think it must have gotten fixed at some point, because that code is no longer in Class::Prototyped and it's been passing test suites for 5.6 and 6.8 for sometime. I'm guessing that the patches you identified must have somehow broken the behavior of splice on @ISA. I don't have a problem doing a release of Class::Prototyped to fix this issue if that's the preferred approach. On the other hand, if it's preferable to fix splice for @ISA, that's another solution! :-) Please cc me on any followup to this e-mail as I'm not on the perl5-porters mailing list. Thanks, --Toby Ovod-Everett On Sat, Dec 15, 2007 at 12:14:38AM -0500, Andreas Koenig via RT wrote: Show quoted text
> > Sat Dec 15 00:14:26 2007: Request 31556 was acted upon. > Transaction: Ticket created by ANDK > Queue: Class-Prototyped > Subject: Doesn't work with 5.10 > Broken in: 1.10 > Severity: Critical > Owner: Nobody > Requestors: ANDK@cpan.org > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=31556 > > > > http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2007-12/msg00308.html > > > The posting describes that patch 30980 to bleadperl broke Class::Prototyped.
CC: 7+793 [...] ovod-everett.org
Subject: Re: [rt.cpan.org #31556] Doesn't work with 5.10
Date: Sun, 16 Dec 2007 07:58:24 -0900
To: "toby [...] ovod-everett.org via RT" <bug-Class-Prototyped [...] rt.cpan.org>
From: Toby Ovod-Everett <toby [...] ovod-everett.org>
Here's the information I was able to track down on the @ISA issues we ran into back in 2001. Turns out chromatic tracked down the resolution we've been using ever since then. In 0.10, I found the @$isa = @$isa code (had to track down those versions in e-mails Ned and I sent each other). In 0.11 it was gone. And then I found the following messages: ======BEGIN MESSAGE====== From: chromatic Date: Sat, 14 Jul 2001 12:34:24 -0600 Subject: More @ISA Fun I couldn't believe that manipulating @ISA was broken in 5.005, so I put together a series of tests. It points to something wrong with isa(). I get the same results on 5.6.0. The attached file puts together two dummy packages and an object. It goes through a few different ways to manipulate the object's @ISA. That works for the method dispatch, but it never seems to invalidate the cache isa() uses. The output should be 6 instances of 'ok' for expected dispatch successes or failures. I see isa() failures on ref_isa() and direct assignment. Additionally, after all of the manipulations, there's a check to see if the initial contents of @ISA are still in the isa() cache. Unfortunately, they are, so it displays "Really bad caching!". I'm curious to see your results. -- c #!/usr/bin/perl -w use strict; package Zot; package Foo; sub foo { } package Bar; # works even without declaring use vars qw( @ISA ); @ISA = ( 'Zot' ); sub new { bless({}, $_[0]); } sub bar {} sub plain_isa { shift; @Bar::ISA = @_; } my $isa = \@Bar::ISA; sub ref_isa { shift; @$isa = @_; } package main; # set up object, attempt normal dispatch my $bar = Bar->new(); $bar->bar(); # check isa() to start print "ISA: (@Bar::ISA)\n"; print "ok\n\n" if $bar->isa('Zot'); # check inheritance, call should fail print "ISA: (@Bar::ISA)\n"; eval { $bar -> foo() }; warn "isa() failed initially!\n" if $bar->isa('Foo'); print "ok\n\n" if ($@ =~ /^Can't locate object method "foo"/); # add parent via ref to @ISA, call should succeed $bar->ref_isa('Foo'); print "ISA: (@Bar::ISA)\n"; eval { $bar -> foo() }; warn "isa() failed after ref_isa()!\n" unless $bar->isa('Foo'); print "ok\n\n" unless $@; # remove parent via direct assignment, call should fail $bar->plain_isa(); print "ISA: (@Bar::ISA)\n"; eval { $bar -> foo() }; warn "isa() failed after plain_isa()!\n" if $bar->isa('Foo'); print "ok\n\n" if ($@ =~ /^Can't locate object method "foo"/); # manipulate inheritance directoy @Bar::ISA = qw( Foo ); print "ISA: (@Bar::ISA)\n"; eval { $bar -> foo() }; warn "isa() failed in direct!\n" unless $bar->isa('Foo'); print "ok\n\n" unless $@; # manipulate via symref in another package { no strict 'refs'; @{ ref($bar) . '::ISA' } = (); } print "ISA: (@Bar::ISA)\n"; eval { $bar -> foo() }; warn "isa() failed!\n" if $bar->isa('Foo'); warn "Really bad caching!\n" if $bar->isa('Zot'); print "ok\n\n" if ($@ =~ /^Can't locate object method "foo"/); =======END MESSAGE======= ======BEGIN MESSAGE====== From: Ned Konz Subject: Re: More @ISA Fun Date: Sat, 14 Jul 2001 12:46:27 -0700 On Saturday 14 July 2001 11:34 am, you wrote: Show quoted text
> I couldn't believe that manipulating @ISA was broken in 5.005, so I put > together a series of tests. It points to something wrong with isa(). I > get the same results on 5.6.0.
Except that it works under 5.6.1 just fine. Ugh. I just installed 5.005 to test with. Of course, both Toby and I have been testing (mostly) under 5.6.1. Show quoted text
> The attached file puts together two dummy packages and an object. It goes > through a few different ways to manipulate the object's @ISA. That works > for the method dispatch, but it never seems to invalidate the cache isa() > uses. > > The output should be 6 instances of 'ok' for expected dispatch successes or > failures. I see isa() failures on ref_isa() and direct assignment. > > Additionally, after all of the manipulations, there's a check to see if the > initial contents of @ISA are still in the isa() cache. Unfortunately, they > are, so it displays "Really bad caching!". > > I'm curious to see your results.
Under 5.005_03: ISA: (Zot) ok ISA: (Zot) ok ISA: (Foo) isa() failed after ref_isa()! ok ISA: () ok ISA: (Foo) isa() failed in direct! ok ISA: () Really bad caching! ok Under 5.6.1: ISA: (Zot) ok ISA: (Zot) ok ISA: (Foo) ok ISA: () ok ISA: (Foo) ok ISA: () ok -- Ned Konz =======END MESSAGE======= ======BEGIN MESSAGE====== From: chromatic Date: Sat, 14 Jul 2001 14:11:44 -0600 Subject: Re: More @ISA Fun On Saturday 14 July 2001 13:46, you wrote: Show quoted text
> > I couldn't believe that manipulating @ISA was broken in 5.005, so I put > > together a series of tests. It points to something wrong with isa(). I > > get the same results on 5.6.0.
> > Except that it works under 5.6.1 just fine. Ugh. I just installed 5.005 to > test with. Of course, both Toby and I have been testing (mostly) under > 5.6.1.
Yes, this seems to have come up on p5p last year. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-03/msg02705.html Borrowing from a fix by Nick Ing-Simmons, I've created another patch that fixes that particular nastiness. My test and t/include.t now both run correctly. -- c =======END MESSAGE======= And, cropping the patch down to some example lines: ======BEGIN PATCH SEGMENT====== @@ -779,7 +793,11 @@ my $splice_point = $parent_header ? 0 : @$parentOrder; splice( @$isa, $splice_point, 0, $parentPackage ); - @$isa = @$isa; #Defends against ISA caching problems + { + #Defends against ISA caching problems + no strict 'refs'; + delete ${"$package\::"}{'::ISA::CACHE::'}; + } splice( @$parentOrder, $splice_point, 0, $slot ); } else { =======END PATCH SEGMENT======= So, on July 14, 2001, we changed our workaround for the ISA caching problems from using @$isa = @$isa to deleting ::ISA::CACHE:: from the namespace. Which worked for 5.005 through 5.8. Should I return to @$isa = @$isa? Or is there a new approved mechanism for resetting the ISA cache? --Toby Ovod-Everett
CC: perl5-porters [...] perl.org
Subject: Re: [rt.cpan.org #31556] Doesn't work with 5.10
Date: Sun, 16 Dec 2007 07:58:56 -0900
To: "toby [...] ovod-everett.org via RT" <bug-Class-Prototyped [...] rt.cpan.org>
From: Toby Ovod-Everett <toby [...] ovod-everett.org>
Here's the information I was able to track down on the @ISA issues we ran into back in 2001. Turns out chromatic tracked down the resolution we've been using ever since then. In 0.10, I found the @$isa = @$isa code (had to track down those versions in e-mails Ned and I sent each other). In 0.11 it was gone. And then I found the following messages: ======BEGIN MESSAGE====== From: chromatic Date: Sat, 14 Jul 2001 12:34:24 -0600 Subject: More @ISA Fun I couldn't believe that manipulating @ISA was broken in 5.005, so I put together a series of tests. It points to something wrong with isa(). I get the same results on 5.6.0. The attached file puts together two dummy packages and an object. It goes through a few different ways to manipulate the object's @ISA. That works for the method dispatch, but it never seems to invalidate the cache isa() uses. The output should be 6 instances of 'ok' for expected dispatch successes or failures. I see isa() failures on ref_isa() and direct assignment. Additionally, after all of the manipulations, there's a check to see if the initial contents of @ISA are still in the isa() cache. Unfortunately, they are, so it displays "Really bad caching!". I'm curious to see your results. -- c #!/usr/bin/perl -w use strict; package Zot; package Foo; sub foo { } package Bar; # works even without declaring use vars qw( @ISA ); @ISA = ( 'Zot' ); sub new { bless({}, $_[0]); } sub bar {} sub plain_isa { shift; @Bar::ISA = @_; } my $isa = \@Bar::ISA; sub ref_isa { shift; @$isa = @_; } package main; # set up object, attempt normal dispatch my $bar = Bar->new(); $bar->bar(); # check isa() to start print "ISA: (@Bar::ISA)\n"; print "ok\n\n" if $bar->isa('Zot'); # check inheritance, call should fail print "ISA: (@Bar::ISA)\n"; eval { $bar -> foo() }; warn "isa() failed initially!\n" if $bar->isa('Foo'); print "ok\n\n" if ($@ =~ /^Can't locate object method "foo"/); # add parent via ref to @ISA, call should succeed $bar->ref_isa('Foo'); print "ISA: (@Bar::ISA)\n"; eval { $bar -> foo() }; warn "isa() failed after ref_isa()!\n" unless $bar->isa('Foo'); print "ok\n\n" unless $@; # remove parent via direct assignment, call should fail $bar->plain_isa(); print "ISA: (@Bar::ISA)\n"; eval { $bar -> foo() }; warn "isa() failed after plain_isa()!\n" if $bar->isa('Foo'); print "ok\n\n" if ($@ =~ /^Can't locate object method "foo"/); # manipulate inheritance directoy @Bar::ISA = qw( Foo ); print "ISA: (@Bar::ISA)\n"; eval { $bar -> foo() }; warn "isa() failed in direct!\n" unless $bar->isa('Foo'); print "ok\n\n" unless $@; # manipulate via symref in another package { no strict 'refs'; @{ ref($bar) . '::ISA' } = (); } print "ISA: (@Bar::ISA)\n"; eval { $bar -> foo() }; warn "isa() failed!\n" if $bar->isa('Foo'); warn "Really bad caching!\n" if $bar->isa('Zot'); print "ok\n\n" if ($@ =~ /^Can't locate object method "foo"/); =======END MESSAGE======= ======BEGIN MESSAGE====== From: Ned Konz Subject: Re: More @ISA Fun Date: Sat, 14 Jul 2001 12:46:27 -0700 On Saturday 14 July 2001 11:34 am, you wrote: Show quoted text
> I couldn't believe that manipulating @ISA was broken in 5.005, so I put > together a series of tests. It points to something wrong with isa(). I > get the same results on 5.6.0.
Except that it works under 5.6.1 just fine. Ugh. I just installed 5.005 to test with. Of course, both Toby and I have been testing (mostly) under 5.6.1. Show quoted text
> The attached file puts together two dummy packages and an object. It goes > through a few different ways to manipulate the object's @ISA. That works > for the method dispatch, but it never seems to invalidate the cache isa() > uses. > > The output should be 6 instances of 'ok' for expected dispatch successes or > failures. I see isa() failures on ref_isa() and direct assignment. > > Additionally, after all of the manipulations, there's a check to see if the > initial contents of @ISA are still in the isa() cache. Unfortunately, they > are, so it displays "Really bad caching!". > > I'm curious to see your results.
Under 5.005_03: ISA: (Zot) ok ISA: (Zot) ok ISA: (Foo) isa() failed after ref_isa()! ok ISA: () ok ISA: (Foo) isa() failed in direct! ok ISA: () Really bad caching! ok Under 5.6.1: ISA: (Zot) ok ISA: (Zot) ok ISA: (Foo) ok ISA: () ok ISA: (Foo) ok ISA: () ok -- Ned Konz =======END MESSAGE======= ======BEGIN MESSAGE====== From: chromatic Date: Sat, 14 Jul 2001 14:11:44 -0600 Subject: Re: More @ISA Fun On Saturday 14 July 2001 13:46, you wrote: Show quoted text
> > I couldn't believe that manipulating @ISA was broken in 5.005, so I put > > together a series of tests. It points to something wrong with isa(). I > > get the same results on 5.6.0.
> > Except that it works under 5.6.1 just fine. Ugh. I just installed 5.005 to > test with. Of course, both Toby and I have been testing (mostly) under > 5.6.1.
Yes, this seems to have come up on p5p last year. http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-03/msg02705.html Borrowing from a fix by Nick Ing-Simmons, I've created another patch that fixes that particular nastiness. My test and t/include.t now both run correctly. -- c =======END MESSAGE======= And, cropping the patch down to some example lines: ======BEGIN PATCH SEGMENT====== @@ -779,7 +793,11 @@ my $splice_point = $parent_header ? 0 : @$parentOrder; splice( @$isa, $splice_point, 0, $parentPackage ); - @$isa = @$isa; #Defends against ISA caching problems + { + #Defends against ISA caching problems + no strict 'refs'; + delete ${"$package\::"}{'::ISA::CACHE::'}; + } splice( @$parentOrder, $splice_point, 0, $slot ); } else { =======END PATCH SEGMENT======= So, on July 14, 2001, we changed our workaround for the ISA caching problems from using @$isa = @$isa to deleting ::ISA::CACHE:: from the namespace. Which worked for 5.005 through 5.8. Should I return to @$isa = @$isa? Or is there a new approved mechanism for resetting the ISA cache? --Toby Ovod-Everett
CC: "toby [...] ovod-everett.org via RT" <bug-Class-Prototyped [...] rt.cpan.org>, perl5-porters [...] perl.org
Subject: Re: [rt.cpan.org #31556] Doesn't work with 5.10
Date: Mon, 17 Dec 2007 11:55:04 +0100
To: "Toby Ovod-Everett" <toby [...] ovod-everett.org>
From: "Rafael Garcia-Suarez" <rgarciasuarez [...] gmail.com>
On 16/12/2007, Toby Ovod-Everett <toby@ovod-everett.org> wrote: Show quoted text
> So, on July 14, 2001, we changed our workaround for the ISA caching problems > from using @$isa = @$isa to deleting ::ISA::CACHE:: from the namespace. > > Which worked for 5.005 through 5.8. Should I return to @$isa = @$isa? Or is > there a new approved mechanism for resetting the ISA cache?
You can probably use a function in the mro package, but the @$isa=@$isa way to do it is backwards compatible, so you can stick with it. ISA::CACHE is no longer used in 5.10. I'll mention that in perldelta.
CC: Toby Ovod-Everett <toby [...] ovod-everett.org>, "toby [...] ovod-everett.org via RT" <bug-Class-Prototyped [...] rt.cpan.org>, perl5-porters [...] perl.org
Subject: Re: [rt.cpan.org #31556] Doesn't work with 5.10
Date: Mon, 17 Dec 2007 19:01:51 -0900
To: Rafael Garcia-Suarez <rgarciasuarez [...] gmail.com>
From: Toby Ovod-Everett <toby [...] ovod-everett.org>
On Mon, Dec 17, 2007 at 11:55:04AM +0100, Rafael Garcia-Suarez wrote: Show quoted text
> On 16/12/2007, Toby Ovod-Everett <toby@ovod-everett.org> wrote:
> > So, on July 14, 2001, we changed our workaround for the ISA caching problems > > from using @$isa = @$isa to deleting ::ISA::CACHE:: from the namespace. > > > > Which worked for 5.005 through 5.8. Should I return to @$isa = @$isa? Or is > > there a new approved mechanism for resetting the ISA cache?
> > You can probably use a function in the mro package, but the > @$isa=@$isa way to do it is backwards compatible, so you can stick > with it. > > ISA::CACHE is no longer used in 5.10. I'll mention that in perldelta.
You might also want to mention that the ISA caching behavior has another issue in it 5.10 that may require the use of mro::method_changed_in or mro::invalidate_all_method_caches. In 5.8.8, I can comment out both the ::ISA::CACHE:: code and the @$isa=@$isa code and everything in C::P passes the test suite. In 5.10, the @$isa=@$isa line is required to get the test suite to pass. We only had the ::ISA::CACHE:: code in C::P to support 5.6.0 and earlier revs of Perl that had issues with splice being used on @ISA. It looks like the issue with 5.10 is different than the issue with pre-5.6.1 code. For instance, the test suite chromatic came up with related to our issues back then failed with pre-5.6.1 but passes with 5.10. But the following test fails under 5.10 and passes under 5.8.8: =====BEGIN PERL CODE===== package Foo; sub foo { print "This is Foo::foo\n"; } package Bar; @Bar::ISA = ( ); splice(@Bar::ISA, 0, 0, 'Foo'); Bar->foo; ======END PERL CODE====== Interestingly, it appears that using splice on @ISA is only a problem if @ISA both exists and is empty (took me a while to figure that one out)! The failure (Can't locate object method "foo" via package "Bar") was seen against: This is perl, v5.10.0 built for MSWin32-x86-multi-thread (with 2 registered patches, see perl -V for more detail) Copyright 1987-2007, Larry Wall Binary build 1000 [283192] Beta provided by ActiveState http://www.ActiveState.com Built Nov 22 2007 14:37:48 Thoughts? I think I can still download ActiveState builds for 5.005_03, so I should be able to put together test vectors for 5.005_03, 5.6.0, 5.6.x, 5.8.x, and 5.10.0 to validate any resolution we come up with. My preference is first for functionality against all versions and second for performance. Should I go for the belt and suspenders approach and use both ::ISA::CACHE:: and @$isa=@$isa everywhere I use splice against @ISA just to be safe? It still might be nice to figure out why the above code fails under 5.10, though. For what it's worth, Class::Prototyped stresses the dynamic capabilities of the Perl object system pretty intensively (and a whole bunch of other stuff as well). Making the interface pretty came at the expense of some evil tricks on the inside. So it doesn't surprise me that there might be changes to Perl that introduce subtle bugs that only end up surfacing in C::P. --Toby Ovod-Everett
CC: "toby [...] ovod-everett.org via RT" <bug-Class-Prototyped [...] rt.cpan.org>, perl5-porters [...] perl.org
Subject: Re: [rt.cpan.org #31556] Doesn't work with 5.10
Date: Tue, 18 Dec 2007 08:48:45 +0100
To: "Toby Ovod-Everett" <toby [...] ovod-everett.org>
From: "Rafael Garcia-Suarez" <rgarciasuarez [...] gmail.com>
On 18/12/2007, Toby Ovod-Everett <toby@ovod-everett.org> wrote: Show quoted text
> Interestingly, it appears that using splice on @ISA is only a problem if @ISA > both exists and is empty (took me a while to figure that one out)!
That's typically a bug.
CC: Toby Ovod-Everett <toby [...] ovod-everett.org>, "toby [...] ovod-everett.org via RT" <bug-Class-Prototyped [...] rt.cpan.org>, perl5-porters [...] perl.org
Subject: Re: [rt.cpan.org #31556] Doesn't work with 5.10
Date: Tue, 18 Dec 2007 06:23:58 -0900
To: Rafael Garcia-Suarez <rgarciasuarez [...] gmail.com>
From: Toby Ovod-Everett <toby [...] ovod-everett.org>
On Tue, Dec 18, 2007 at 08:48:45AM +0100, Rafael Garcia-Suarez wrote: Show quoted text
> On 18/12/2007, Toby Ovod-Everett <toby@ovod-everett.org> wrote:
> > Interestingly, it appears that using splice on @ISA is only a problem if @ISA > > both exists and is empty (took me a while to figure that one out)!
> > That's typically a bug.
If that bug is fixed (and there are no other bugs when manipulating @ISA), there's a very good chance Class::Prototyped will run as-is without problems on 5.10. Otherwise, I'll need to use the @$isa=@$isa workaround. I have managed to test C::P against the following versions of ActivePerl: * 5.6.0-623 * 5.6.1-626 * 5.8.0-802 * 5.8.8-822 * 5.10.0-1000 Unfortunately, the earlier versions of ActivePerl aren't made available in a .zip format, so they have to be installed. I'd rather not risk hosing up my production home machine with 8 year old versions of Perl (i.e. 5.005_03-514 and 5.6.0-611). I'm leaving on vacation tomorrow for 3 weeks, and I'm not going to have time today at work to do installs into a VM so I can grab .zip files of the directory tree for testing. I should be able to do that when I get back, though, at which point I should be able to indefinitely maintain a set of versions of Perl to test against. With both the @$isa=@$isa and the ::ISA::CACHE:: code disabled, the full test suite for Class::Prototyped passed under all of those versions except for 5.10.0-1000, which I imagine is related to the bug identified above. Is there a rough estimate for the release of 5.10? Should I release a version of Class::Prototyped with both the ::ISA::CACHE:: and @$isa=@$isa workarounds in it and then plan on paring those lines back when I get back from vacation and can test against both earlier versions of Perl and the released version of 5.10? --Toby Ovod-Everett
CC: "toby [...] ovod-everett.org via RT" <bug-Class-Prototyped [...] rt.cpan.org>, perl5-porters [...] perl.org
Subject: Re: [rt.cpan.org #31556] Doesn't work with 5.10
Date: Tue, 18 Dec 2007 16:29:40 +0100
To: "Toby Ovod-Everett" <toby [...] ovod-everett.org>
From: "Rafael Garcia-Suarez" <rgarciasuarez [...] gmail.com>
On 18/12/2007, Toby Ovod-Everett wrote: Show quoted text
> Is there a rough estimate for the release of 5.10?
Probably in a few hours. We were in code freeze, except for critical bugs, for weeks. Show quoted text
> Should I release a version > of Class::Prototyped with both the ::ISA::CACHE:: and @$isa=@$isa workarounds > in it and then plan on paring those lines back when I get back from vacation > and can test against both earlier versions of Perl and the released version of > 5.10?
I think the workarounds need to go in, yes. The bug is not critical, it will be fixed in 5.10.1 hopefully.
CC: "Toby Ovod-Everett" <toby [...] ovod-everett.org>, "toby [...] ovod-everett.org via RT" <bug-Class-Prototyped [...] rt.cpan.org>, "Rafael Garcia-Suarez" <rgarciasuarez [...] gmail.com>
Subject: Re: [rt.cpan.org #31556] Doesn't work with 5.10
Date: Tue, 18 Dec 2007 10:11:09 -0600
To: "Perl 5 Porters" <perl5-porters [...] perl.org>
From: "Brandon Black" <blblack [...] gmail.com>
On Dec 18, 2007 9:29 AM, Rafael Garcia-Suarez <rgarciasuarez@gmail.com> wrote: Show quoted text
> On 18/12/2007, Toby Ovod-Everett wrote:
> > Is there a rough estimate for the release of 5.10?
> > Probably in a few hours. We were in code freeze, except for > critical bugs, for weeks. >
> > Should I release a version > > of Class::Prototyped with both the ::ISA::CACHE:: and @$isa=@$isa workarounds > > in it and then plan on paring those lines back when I get back from vacation > > and can test against both earlier versions of Perl and the released version of > > 5.10?
> > I think the workarounds need to go in, yes. The bug is not critical, it will > be fixed in 5.10.1 hopefully. >
Sorry this thread slipped under my radar somehow. Splicing @ISA probably isn't the only broken operation, but this stuff doesn't get tested much because 99.99% of all Perl software at most uses assignment and push to set simple @ISAs. Another one we already know about is aliasing @ISA between two packages. I'd love it if we could get @ISA to be as flexible as every other array in Perl, but it's not there yet. The aliasing is probably more 5.11 material because it's complicated. Toby: the @$isa = @$isa trick is fine for now, it won't break anything and is probably the most compatible thing to do. Assigning an @ISA to itself is effectively a way to do "PL_sub_generation++" on older Perls, and a way to trigger the mro code to notice the change in 5.10. It's important to note that on the older Perls, just assigning any one @ISA to itself would fix up every cache in the whole interpreter, whereas on 5.10, you really need to do it for each affected @ISA individually. -- Brandon
CC: Perl 5 Porters <perl5-porters [...] perl.org>, Toby Ovod-Everett <toby [...] ovod-everett.org>, "toby [...] ovod-everett.org via RT" <bug-Class-Prototyped [...] rt.cpan.org>, Rafael Garcia-Suarez <rgarciasuarez [...] gmail.com>
Subject: Re: [rt.cpan.org #31556] Doesn't work with 5.10
Date: Tue, 18 Dec 2007 16:56:48 -0900
To: Brandon Black <blblack [...] gmail.com>
From: Toby Ovod-Everett <toby [...] ovod-everett.org>
On Tue, Dec 18, 2007 at 10:11:09AM -0600, Brandon Black wrote: Show quoted text
> On Dec 18, 2007 9:29 AM, Rafael Garcia-Suarez <rgarciasuarez@gmail.com> wrote:
> > On 18/12/2007, Toby Ovod-Everett wrote:
> > > Is there a rough estimate for the release of 5.10?
> > > > Probably in a few hours. We were in code freeze, except for > > critical bugs, for weeks. > >
> > > Should I release a version > > > of Class::Prototyped with both the ::ISA::CACHE:: and @$isa=@$isa workarounds > > > in it and then plan on paring those lines back when I get back from vacation > > > and can test against both earlier versions of Perl and the released version of > > > 5.10?
> > > > I think the workarounds need to go in, yes. The bug is not critical, it will > > be fixed in 5.10.1 hopefully. > >
> > Sorry this thread slipped under my radar somehow. Splicing @ISA > probably isn't the only broken operation, but this stuff doesn't get > tested much because 99.99% of all Perl software at most uses > assignment and push to set simple @ISAs. Another one we already know > about is aliasing @ISA between two packages. I'd love it if we could > get @ISA to be as flexible as every other array in Perl, but it's not > there yet. The aliasing is probably more 5.11 material because it's > complicated. > > Toby: the @$isa = @$isa trick is fine for now, it won't break anything > and is probably the most compatible thing to do. Assigning an @ISA to > itself is effectively a way to do "PL_sub_generation++" on older > Perls, and a way to trigger the mro code to notice the change in 5.10. > It's important to note that on the older Perls, just assigning any > one @ISA to itself would fix up every cache in the whole interpreter, > whereas on 5.10, you really need to do it for each affected @ISA > individually.
I can probably get rid of the ::ISA::CACHE:: code and just rely on @$isa = @$isa, but I'll worry about that at a later date. C::P 1.11 was just posted to CPAN. I'm a little unhappy that I can't figure out why when I build it on my Linux box it won't create the HTML files for the PPM file. Works fine when built under Win32, but then I end up with CRLF formatted files, and in non-Win32 modules I prefer to build under Linux so I can more easily get Unix-formatted files (Windows machines deal with Unix-formatted files better than Unix machines deal with DOS-formatted files). I'm using Fedora 8, standard Fedora Perl install, with Module-Build installed from the normal Fedora 8 repositories. The Build.PL file is in the distribution, and I'm using the following process to build the files: rm *.ppd rm -rf MSWin32-x86-multi-thread rm *.tar.gz rm *.zip ./Build realclean perl Build.PL rm MANIFEST rm MANIFEST.bak ./Build manifest ./Build ppmzip --tar tar --gzip gzip ./Build clean ./Build dist --tar tar --gzip gzip rm -rf *.ppd rm -rf MSWin32-x86-multi-thread mv -f *.tar.gz .. mv -f *.zip .. ./Build realclean Of course, I haven't messed with building modules in ages, and there have been rebuilds of the Linux box since then. Who knows. Looks like modern ActivePerl installs may auto-build the HTML files when installing via PPM anyway. --Toby Ovod-Everett