Skip Menu |

This queue is for tickets about the Debuggit CPAN distribution.

Report information
The Basics
Id: 90433
Status: resolved
Priority: 0/
Queue: Debuggit

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

Bug Information
Severity: (no value)
Broken in: 2.05
Fixed in: 2.06



Subject: Fails since bleadperl v5.19.2-138-g137da2b
In a bisect run I determined v5.19.2-138-g137da2b as the commit since which Debuggit-2.05 delivers failing tests. You can read more about that commit at https://rt.perl.org/Public/Bug/Display.html?id=119047 HTH && Thanks,
On Sat Nov 16 02:55:20 2013, ANDK wrote: Show quoted text
> In a bisect run I determined v5.19.2-138-g137da2b as the commit since > which Debuggit-2.05 delivers failing tests. > > You can read more about that commit at > https://rt.perl.org/Public/Bug/Display.html?id=119047
That change was reverted before 5.20, but now we have tried a different approach. Any use of sub(){$x} to create constants, where $x could be modified elsewhere, is deprecated. The tests for Debuggit warn, but still pass. The attached patch fixes the warnings.
Subject: open_XUlQskbF.txt
diff -rup Debuggit-2.05-3ZL4RV-orig/lib/Debuggit.pm Debuggit-2.05-3ZL4RV/lib/Debuggit.pm --- Debuggit-2.05-3ZL4RV-orig/lib/Debuggit.pm 2014-11-17 22:09:06.000000000 -0800 +++ Debuggit-2.05-3ZL4RV/lib/Debuggit.pm 2014-11-17 22:09:14.000000000 -0800 @@ -154,7 +154,11 @@ sub import my $debug_value = defined $opts{DEBUG} ? $opts{DEBUG} : defined $master_debug ? $master_debug : 0; unless (defined $master_debug) { - *Debuggit::DEBUG = sub () { $debug_value }; + # Perl does not know whether the string eval below will modify + # $debug_value, so it assumes the worst. So make the constant out + # of a new lexical scalar outside the eval's visible scope. + my $dbv2 = $debug_value; + *Debuggit::DEBUG = sub () { $dbv2 }; $master_debug = $debug_value; } @@ -170,7 +174,8 @@ sub import { # Thanx to tye from perlmonks for this line of code, which solves the Pod::Coverage issue # (see t/pod_coverage.t). http://www.perlmonks.org/?node_id=951831 - *{ join('::', $caller_package, 'DEBUG') } = sub () { $debug_value }; + my $dbv2 = $debug_value; # See comment above about $dbv2. + *{ join('::', $caller_package, 'DEBUG') } = sub () { $dbv2 }; } if ($debug_value)
Patched, released as dev, no failures from CPAN Testers, promoted to full, released again. Closing ticket.