Skip Menu |
Report information
Id: 121574
Status: resolved
Priority: 0/
Queue: perl5

Owner: tonyc <tony [at] develop-help.com>
Requestors: ether <ether [at] cpan.org>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type:
  • unknown
  • Patch
Perl Version: (no value)
Fixed In: (no value)



Date: Thu, 3 Apr 2014 11:29:32 -0700
To: perlbug [...] perl.org
Subject: [PATCH] ignore insignificant version discrepancies between Carp and Carp::Heavy
From: Karen Etheridge <ether [...] cpan.org>
Patch was prepared via "git format-patch -1", and is included as an attachment.

Message body is not shown because sender requested not to inline it.

Date: Thu, 3 Apr 2014 19:55:48 +0100
To: perl5-porters [...] perl.org
Subject: Re: [perl #121574] [PATCH] ignore insignificant version discrepancies between Carp and Carp::Heavy
From: Zefram <zefram [...] fysh.org>
Download (untitled) / with headers
text/plain 559b
Karen Etheridge wrote: Show quoted text
> my $cv = defined($Carp::VERSION) ? $Carp::VERSION : "undef"; >+if($cv ne $VERSION and ($cv lt '1.12' or $VERSION lt '1.12')) {
$VERSION can't be lt 1.12, having been set earlier in the same file to a higher version. $cv lt 1.12 mishandles the undef case. $cv ne $VERSION is redundant with the lt check. String comparisons are not correct for inequality comparisons of version numbers. You want something like if (($Carp::VERSION || 0) < 1.12) { my $cv = defined($Carp::VERSION) ? $Carp::VERSION : "undef"; -zefram
From: Karen Etheridge <perl [...] froods.org>
Subject: Re: [perl #121574] [PATCH] ignore insignificant version discrepancies between Carp and Carp::Heavy
To: perl5-porters [...] perl.org
Date: Thu, 3 Apr 2014 12:02:36 -0700
Download (untitled) / with headers
text/plain 675b
Agreed. I'll attach a new patch. On Thu, Apr 03, 2014 at 07:55:48PM +0100, Zefram wrote: Show quoted text
> Karen Etheridge wrote:
> > my $cv = defined($Carp::VERSION) ? $Carp::VERSION : "undef"; > >+if($cv ne $VERSION and ($cv lt '1.12' or $VERSION lt '1.12')) {
> > $VERSION can't be lt 1.12, having been set earlier in the same file to a > higher version. $cv lt 1.12 mishandles the undef case. $cv ne $VERSION > is redundant with the lt check. String comparisons are not correct for > inequality comparisons of version numbers. You want something like > > if (($Carp::VERSION || 0) < 1.12) { > my $cv = defined($Carp::VERSION) ? $Carp::VERSION : "undef"; > > -zefram
RT-Send-CC: perl5-porters [...] perl.org
Better patch attached. Thanks, Zefram!
Subject: 0001-Ignore-mismatched-versions-between-Carp-and-Carp-Hea.patch
From 90216e5dc2f8bccd094a859e697ea4cdbaa19830 Mon Sep 17 00:00:00 2001 From: Karen Etheridge <ether@cpan.org> Date: Thu, 3 Apr 2014 11:08:20 -0700 Subject: [PATCH] Ignore mismatched versions between Carp and Carp::Heavy if the version discrepancy does not actually lead to broken code Carp::Heavy's guts were merged into Carp in 1.12. After this point, if a different version of Carp::Heavy is loaded than Carp, no harm will be done and the error can be ignored. --- dist/Carp/lib/Carp.pm | 2 +- dist/Carp/lib/Carp/Heavy.pm | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm index 24c0cd1..99b6945 100644 --- a/dist/Carp/lib/Carp.pm +++ b/dist/Carp/lib/Carp.pm @@ -87,7 +87,7 @@ BEGIN { } } -our $VERSION = '1.33'; +our $VERSION = '1.34'; our $MaxEvalLen = 0; our $Verbose = 0; diff --git a/dist/Carp/lib/Carp/Heavy.pm b/dist/Carp/lib/Carp/Heavy.pm index 5e13cb2..3ca266e 100644 --- a/dist/Carp/lib/Carp/Heavy.pm +++ b/dist/Carp/lib/Carp/Heavy.pm @@ -2,10 +2,12 @@ package Carp::Heavy; use Carp (); -our $VERSION = '1.33'; +our $VERSION = '1.34'; -my $cv = defined($Carp::VERSION) ? $Carp::VERSION : "undef"; -if($cv ne $VERSION) { +# Carp::Heavy was merged into Carp in version 1.12. Any mismatched versions +# after this point are not significant and can be ignored. +if(($Carp::VERSION || 0) < 1.12)) { + my $cv = defined($Carp::VERSION) ? $Carp::VERSION : "undef"; die "Version mismatch between Carp $cv ($INC{q(Carp.pm)}) and Carp::Heavy $VERSION ($INC{q(Carp/Heavy.pm)}). Did you alter \@INC after Carp was loaded?\n"; } -- 1.8.5.4
RT-Send-CC: perl5-porters [...] perl.org
Horrible parenthetical error fixed.
Subject: 0001-Ignore-mismatched-versions-between-Carp-and-Carp-Hea.patch
From 90216e5dc2f8bccd094a859e697ea4cdbaa19830 Mon Sep 17 00:00:00 2001 From: Karen Etheridge <ether@cpan.org> Date: Thu, 3 Apr 2014 11:08:20 -0700 Subject: [PATCH] Ignore mismatched versions between Carp and Carp::Heavy if the version discrepancy does not actually lead to broken code Carp::Heavy's guts were merged into Carp in 1.12. After this point, if a different version of Carp::Heavy is loaded than Carp, no harm will be done and the error can be ignored. --- dist/Carp/lib/Carp.pm | 2 +- dist/Carp/lib/Carp/Heavy.pm | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/Carp/lib/Carp.pm b/dist/Carp/lib/Carp.pm index 24c0cd1..99b6945 100644 --- a/dist/Carp/lib/Carp.pm +++ b/dist/Carp/lib/Carp.pm @@ -87,7 +87,7 @@ BEGIN { } } -our $VERSION = '1.33'; +our $VERSION = '1.34'; our $MaxEvalLen = 0; our $Verbose = 0; diff --git a/dist/Carp/lib/Carp/Heavy.pm b/dist/Carp/lib/Carp/Heavy.pm index 5e13cb2..3ca266e 100644 --- a/dist/Carp/lib/Carp/Heavy.pm +++ b/dist/Carp/lib/Carp/Heavy.pm @@ -2,10 +2,12 @@ package Carp::Heavy; use Carp (); -our $VERSION = '1.33'; +our $VERSION = '1.34'; -my $cv = defined($Carp::VERSION) ? $Carp::VERSION : "undef"; -if($cv ne $VERSION) { +# Carp::Heavy was merged into Carp in version 1.12. Any mismatched versions +# after this point are not significant and can be ignored. +if(($Carp::VERSION || 0) < 1.12) { + my $cv = defined($Carp::VERSION) ? $Carp::VERSION : "undef"; die "Version mismatch between Carp $cv ($INC{q(Carp.pm)}) and Carp::Heavy $VERSION ($INC{q(Carp/Heavy.pm)}). Did you alter \@INC after Carp was loaded?\n"; } -- 1.8.5.4
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 162b
On Thu Apr 03 12:22:49 2014, ether wrote: Show quoted text
> Horrible parenthetical error fixed. >
This looks sane to me, added as a 5.21.1 blocker since blead is frozen. Tony
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 150b
On Thu Apr 03 12:22:49 2014, ether wrote: Show quoted text
> Horrible parenthetical error fixed. >
Thanks, applied as a18468ad888b2ce01fc1e93ff467b83bd297d54d. Tony


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org