Skip Menu |

This queue is for tickets about the Coro CPAN distribution.

Report information
The Basics
Id: 16308
Status: resolved
Priority: 0/
Queue: Coro

People
Owner: Nobody in particular
Requestors: SAMV [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.5
Fixed in: (no value)



Subject: Coro doesn't compile on 5.6.1
Coro doesn't build against older Perls. Attached is a patch to get it to work for Perl 5.6.1 and later; ppport.h supports earlier versions, but I don't think it's worth backporting to versions you don't intend testing on. As 5.6.1 is now the earliest version supported, there is no reason not to just "use warnings" directly, rather than use the BEGIN { } block that tried to do that inside eval { }, presumably for backwards compatibility. Note the ppport.h file is delivered by "h2xs".

Message body is not shown because it is too large.

From: rt.cpan.org [...] plan9.de
[SAMV - Mon Dec 5 18:36:53 2005]: Show quoted text
> Attached is a patch to get it to work for Perl 5.6.1 and later; > ppport.h supports earlier versions, but I don't think it's worth > backporting to versions you don't intend testing on.
I don't intend to actively support 5.6 either. It's too buggy to be useful to me under any circumstances, so it would add considerable maintainance burden. If you wanted to keep an eye on it, though, and the changes aren't too invasive, I wouldn't mind applying patches to the effect. Some question about the patch, though: +use warnings; +no warnings "uninitialized"; I do not intend to enable warnings by default. +# this is slightly PL_dirty (should expose a c-level api) This seems to be the result of a straight search and replace on the code. It seesm these and similar changes are, too: - COP *curcop; + COP *PL_curcop; Or are they really necessary? They uglify the code quite a bit, and I am sure it'll break on some platforms. -#if PATCHLEVEL < 6 +#if PERL_VERSION < 6 applied in any case. Show quoted text
> > As 5.6.1 is now the earliest version supported, there is no reason not > to just "use warnings" directly, rather than use the BEGIN { }
I already started doing that in 1.5 (which was the reason for the "compatibility cruft" changelog line). No need to change working code, though.
From: SAMV [...] cpan.org
Show quoted text
> > Attached is a patch to get it to work for Perl 5.6.1 and later; > > ppport.h supports earlier versions, but I don't think it's worth > > backporting to versions you don't intend testing on.
> I don't intend to actively support 5.6 either. It's too buggy to be > useful to me under any circumstances, so it would add considerable > maintainance burden. If you wanted to keep an eye on it, though, and > the changes aren't too invasive, I wouldn't mind applying patches to > the effect.
Yes, what I'll do is share my 5.6.1 compat patches while I am using it on that Perl, which probably won't be for more than a year. Show quoted text
> Some question about the patch, though: > > +use warnings; > +no warnings "uninitialized"; > > I do not intend to enable warnings by default.
OK, this means I misread the intent of what you were doing. It was just to avoid a "use of bareword 'warnings' may conflict with future reserved word..." warning. Turning on "use strict" should sort that out - the bareword will be considered illegal. Show quoted text
> +# this is slightly PL_dirty (should expose a c-level api) > This seems to be the result of a straight search and replace on the > code. It seesm these and similar changes are, too: > - COP *curcop; > + COP *PL_curcop; > Or are they really necessary? They uglify the code quite a bit, and I > am sure it'll break on some platforms.
I ran the ppport.h against the distribution, and applied the patch it recommended. Perhaps some of the substitutions it suggested were based on sloppy regexes and are not necessary. Here are the exact steps I used to create the patch (other than manual editing for the "use warnings" bit): h2xs -n Foo -A -b5.6.1 cp Foo/ppport.h Coro-1.5/ cd Coro-1.5 perl ppport.h --patch=backport --compat-version=5.6.1 patch -p0 < backport find Coro Event -type f | xargs grep -l ppport \ | perl -npi~ -e 's{ppport.h}{../ppport.h}' I guess I could go through the patch and find the minimal set of changes that are actually required for it to compile on 5.6. Do you want me to do this? As far as portability goes, AIUI the ppport.h script suggests code changes that makes the module use functions that are considered "best practice", then uses macros to make the older perls support this newer best practice. So, they should enhance portability between platforms, not reduce it. Just one more piece I missed before; for some reason the test suite spits out an error during global destruction in t/09_timer.t: (in cleanup) Can't call method "cancel" on an undefined value at blib/lib/Coro/Timer.pm line 79. Without digging into the possible causes of this, given all that method is doing is breaking circular refs, it's probably worth just adding a guard to it: --- Coro-1.5.orig/Coro/Timer.pm Tue Nov 29 12:35:50 2005 +++ Coro-1.5.backport/Coro/Timer.pm Tue Dec 6 00:08:50 2005 @@ -75,7 +76,7 @@ } sub DESTROY { - ${${$_[0]}}->cancel; + ${${$_[0]}}->cancel if ${${$_[0]}}; undef ${${$_[0]}}; # without this it leaks like hell. breaks the circular reference inside the closure } ps. you can log into rt.cpan.org with your PAUSE ID and password rather than use guest.
[ Show quoted text
> sub DESTROY { > - ${${$_[0]}}->cancel; > + ${${$_[0]}}->cancel if ${${$_[0]}}; > undef ${${$_[0]}}; # without this it leaks like hell. breaks the > circular reference inside the closure > }
Thanks, I applied this defensively (while still objecting the stupid broken gc run), it will be in coro > 1.7 Show quoted text
> ps. you can log into rt.cpan.org with your PAUSE ID and password > rather > than use guest.
If rt.cpan.org wouldn't be so slow and horribly ugly to use, I'd seriously consider this :)