Skip Menu |

This queue is for tickets about the Devel-SmallProf CPAN distribution.

Report information
The Basics
Id: 125709
Status: open
Priority: 0/
Queue: Devel-SmallProf

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.02
Fixed in: (no value)



Subject: Tests fails with 5.28.0: t/part1.t .. No DB::sub routine defined at t/part1.t line 1.
After applying fix from RT#98192, tests fail since Perl 5.28.0 like this: t/part1.t .. No DB::sub routine defined at t/part1.t line 1. BEGIN failed--compilation aborted at t/part1.t line 2. t/part1.t .. Dubious, test returned 2 (wstat 512, 0x200) No subtests run Attached patch fixes it for me.
Subject: 0001-Remove-DB-sub-declaration.patch
From fd31925e40127b2f45518efbcee60ae7f2da30ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Fri, 29 Jun 2018 13:27:51 +0200 Subject: [PATCH] Remove DB::sub declaration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests fail with Perl 5.28.0: t/part1.t .. No DB::sub routine defined at t/part1.t line 1. BEGIN failed--compilation aborted at t/part1.t line 2. SmallProf.pm contains DB::sub declaration without a corresponding definition with an exaplanation "even if it is not used it has to be declared!" If I remove the declaration, tests pass. Tests pass even on Perl 5.26.2. It seems the hack is not needed anymore and it is even harmfull to Perl 5.28.0. Signed-off-by: Petr Písař <ppisar@redhat.com> --- lib/Devel/SmallProf.pm | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/Devel/SmallProf.pm b/lib/Devel/SmallProf.pm index 4fdd66a..63a94a6 100644 --- a/lib/Devel/SmallProf.pm +++ b/lib/Devel/SmallProf.pm @@ -16,8 +16,6 @@ our ($profile, $drop_zeros, $grep_format, %packages); my ($cdone, $done, $cstart, $start, $prevf, $prevl, $nulltime, %listings, %profiles, %times, %ctimes); -sub sub; # even if it is not used it has to be declared! - sub DB { $profile || return; -- 2.14.4
NYTProf had a similar bug, but it also documents the reason for the sub. Its needed for compat on 5.8

 # DB::sub shouldn't be called, but needs to exist for perl <5.8.7 (<perl@24265)
 # Could be called in obscure cases, e.g. if "perl -d" (not -d:NYTProf)
 # was used with Devel::NYTProf loaded some other way
-sub sub { die "DB::sub called unexpectedly" }
+*sub = sub { warn "DB::sub called unexpectedly (@{[ caller(0) ]})" }
+  if $] < 5.008008;
 
And Makefile.PL suggests 5.8.x is still supported.

https://metacpan.org/source/TIMB/Devel-NYTProf-6.06/Makefile.PL#L11


-- 
- CPAN kentnl@cpan.org
- Gentoo Perl Maintainer kentnl@gentoo.org ( perl@gentoo.org )