Skip Menu |

This queue is for tickets about the Barcode-Code128 CPAN distribution.

Report information
The Basics
Id: 14850
Status: resolved
Priority: 0/
Queue: Barcode-Code128

People
Owner: WRW [...] cpan.org
Requestors: mca+cpanrt [...] sanger.ac.uk
Cc:
AdminCc:

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



Subject: Missing DESTROY method / install tests fail
(Also seen at http://www.issociate.de/board/goto/465877/problem_with_Barcode::Code128.html ) I unpacked Barcode-Code128-2.00.tar.gz from CPAN, and tried to build. The tests for install fail as follows, deskpro261[mca]46: cd Barcode-Code128-2.00 deskpro261[mca]47: ls Changes lib Makefile.PL MANIFEST README t deskpro261[mca]48: perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Barcode::Code128 deskpro261[mca]49: make test cp lib/Barcode/Code128.pm blib/lib/Barcode/Code128.pm PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/barcode....ok 2/2 (in cleanup) Unrecognized option (destroy) for Barcode::Code128 at t/barcode.t line 0 t/barcode....ok t/gif........ok 1/0skipped all skipped: no reason given t/png........NOK 2 (in cleanup) Unrecognized option (destroy) for Barcode::Code128 at t/png.t line 0 t/png........FAILED test 2 Failed 1/2 tests, 50.00% okay Failed Test Stat Wstat Total Fail Failed List of Failed ------------------------------------------------------------------------------- t/png.t 2 1 50.00% 2 1 test skipped. Failed 1/3 test scripts, 66.67% okay. 0/4 subtests failed, 100.00% okay. make: *** [test_dynamic] Error 255 deskpro261[mca]50: uname -a Linux deskpro261 2.6.8-2-686 #1 Mon Jan 24 03:58:38 EST 2005 i686 GNU/Linux deskpro261[mca]51: cat /etc/debian_version 3.1 deskpro261[mca]52: dpkg -s perl [...] Version: 5.8.4-8 [...] This because the object destructor DESTROY is being interpretted by AUTOLOAD as an option. The CPAN installer will correctly install the module if you tell it "force install Barcode::Code128". Here's a fix to v2.00 that might be suitable for distribution, deskpro261[mca]59: diff -u lib/Barcode/Code128.pm{~,} --- lib/Barcode/Code128.pm~ 2001-05-28 22:39:54.000000000 +0100 +++ lib/Barcode/Code128.pm 2005-09-30 12:16:58.000000000 +0100 @@ -286,6 +286,7 @@ my($self, @args) = @_; use vars qw($AUTOLOAD); (my $opt = lc $AUTOLOAD) =~ s/^.*:://; + return if $opt eq 'destroy'; $self->option($opt, @args); } In my code using this module I took a patch-it approach, but this is rather fragile: sub _barcode_pattern { my ($widg, $data) = @_; my $bc = Barcode::Code128->new(); [...] my $str = $bc->barcode($data); # string /^[ #]+$/ for light & dark stripes undef $bc; # Barcode::Code128 v2.00 thinks DESTROY is an invalid # configuration option, and therefore croaks in its own # destructor. Null implementation provided below. return $str; } # Trickery to fix croaking noise, see above BEGIN { no strict 'refs'; die "About to replace Barcode::Code128::DESTROY - ok in v2.00 but this is $Barcode::Code128::VERSION" if *{"Barcode::Code128::DESTROY"}{CODE}; } sub Barcode::Code128::DESTROY { } I add the null DESTROY method prevents AUTOLOAD being called, after first checking that I'm not replacing some existing code.
Date: Fri, 30 Sep 2005 10:41:21 -0700
From: Bill Ward <bill [...] wards.net>
To: bug-Barcode-Code128 [...] rt.cpan.org
Subject: Re: [cpan #14850] Missing DESTROY method / install tests fail
RT-Send-Cc:
On 9/30/05, Guest via RT <bug-Barcode-Code128@rt.cpan.org> wrote: Show quoted text
> > > This message about Barcode-Code128 was sent to you by guest <> via > rt.cpan.org <http://rt.cpan.org> > > Full context and any attached attachments can be found at: > <URL: https://rt.cpan.org/Ticket/Display.html?id=14850 > > > (Also seen at > http://www.issociate.de/board/goto/465877/problem_with_Barcode::Code128.html) > > I unpacked Barcode-Code128-2.00.tar.gz from CPAN, and tried to build. The > tests for install fail as follows, > > deskpro261[mca]46: cd Barcode-Code128-2.00 > deskpro261[mca]47: ls > Changes lib Makefile.PL MANIFEST README t > deskpro261[mca]48: perl Makefile.PL > Checking if your kit is complete... > Looks good > Writing Makefile for Barcode::Code128 > deskpro261[mca]49: make test > cp lib/Barcode/Code128.pm blib/lib/Barcode/Code128.pm > PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" > "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t > t/barcode....ok 2/2 (in cleanup) Unrecognized option (destroy) for > Barcode::Code128 at t/barcode.t line 0 > t/barcode....ok > t/gif........ok 1/0skipped > all skipped: no reason given > t/png........NOK 2 (in cleanup) Unrecognized option (destroy) for > Barcode::Code128 at t/png.t line 0 > t/png........FAILED test 2 > Failed 1/2 tests, 50.00% okay > Failed Test Stat Wstat Total Fail Failed List of Failed > > ------------------------------------------------------------------------------- > t/png.t 2 1 50.00% 2 > 1 test skipped. > Failed 1/3 test scripts, 66.67% okay. 0/4 subtests failed, 100.00% okay. > make: *** [test_dynamic] Error 255 > deskpro261[mca]50: uname -a > Linux deskpro261 2.6.8-2-686 #1 Mon Jan 24 03:58:38 EST 2005 i686 > GNU/Linux > deskpro261[mca]51: cat /etc/debian_version > 3.1 > deskpro261[mca]52: dpkg -s perl > [...] > Version: 5.8.4-8 > [...] > > This because the object destructor DESTROY is being interpretted by > AUTOLOAD as an option. The CPAN installer will correctly install the module > if you tell it "force install Barcode::Code128". > > Here's a fix to v2.00 that might be suitable for distribution, > > deskpro261[mca]59: diff -u lib/Barcode/Code128.pm{~,} > --- lib/Barcode/Code128.pm~ 2001-05-28 22:39:54.000000000 +0100 > +++ lib/Barcode/Code128.pm 2005-09-30 12:16:58.000000000 +0100 > @@ -286,6 +286,7 @@ > my($self, @args) = @_; > use vars qw($AUTOLOAD); > (my $opt = lc $AUTOLOAD) =~ s/^.*:://; > + return if $opt eq 'destroy'; > $self->option($opt, @args); > } > > > In my code using this module I took a patch-it approach, but this is > rather fragile: > > sub _barcode_pattern { > my ($widg, $data) = @_; > > my $bc = Barcode::Code128->new(); > [...] > my $str = $bc->barcode($data); # string /^[ #]+$/ for light & dark stripes > > undef $bc; > # Barcode::Code128 v2.00 thinks DESTROY is an invalid > # configuration option, and therefore croaks in its own > # destructor. Null implementation provided below. > > return $str; > } > > # Trickery to fix croaking noise, see above > BEGIN { > no strict 'refs'; > die "About to replace Barcode::Code128::DESTROY - ok in v2.00 but this is > $Barcode::Code128::VERSION" > if *{"Barcode::Code128::DESTROY"}{CODE}; > } > sub Barcode::Code128::DESTROY { } > > I add the null DESTROY method prevents AUTOLOAD being called, after first > checking that I'm not replacing some existing code. >
Thanks! I don't know why this was never reported before. -- Help save the San Jose Earthquakes - http://www.soccersiliconvalley.com/
From: mca+cpanrt [...] sanger.ac.uk
[bill@wards.net - Fri Sep 30 13:41:48 2005]: Show quoted text
> Thanks! I don't know why this was never reported before.
I think there must be something else going on. Tests have passed for the same version, according to http://testers.cpan.org/show/Barcode-Code128.html Maybe it's something new since 5.8.1? Perhaps UNIVERSAL used to have a DESTROY method? I haven't investigated, sorry. Also I forgot the detailed Perl version info: deskpro261[mca]42: perl -V Summary of my perl5 (revision 5 version 8 subversion 4) configuration: Platform: osname=linux, osvers=2.4.27-ti1211, archname=i386-linux-thread-multi uname='linux kosh 2.4.27-ti1211 #1 sun sep 19 18:17:45 est 2004 i686 gnulinux ' config_args='-Dusethreads -Duselargefiles -Dccflags=-DDEBIAN -Dcccdlflags=-fPIC -Darchname=i386-linux -Dprefix=/usr -Dprivlib=/usr/share/perl/5.8 -Darchlib=/usr/lib/perl/5.8 -Dvendorprefix=/usr -Dvendorlib=/usr/share/perl5 -Dvendorarch=/usr/lib/perl5 -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl/5.8.4 -Dsitearch=/usr/local/lib/perl/5.8.4 -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dsiteman1dir=/usr/local/man/man1 -Dsiteman3dir=/usr/local/man/man3 -Dman1ext=1 -Dman3ext=3perl -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Uusesfio -Uusenm -Duseshrplib -Dlibperl=libperl.so.5.8.4 -Dd_dosuid -des' hint=recommended, useposix=true, d_sigaction=define usethreads=define use5005threads=undef useithreads=define usemultiplicity=define useperlio=define d_sfio=undef uselargefiles=define usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='3.3.5 (Debian 1:3.3.5-9)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lgdbm -lgdbm_compat -ldb -ldl -lm -lpthread -lc -lcrypt perllibs=-ldl -lm -lpthread -lc -lcrypt libc=/lib/libc-2.3.2.so, so=so, useshrplib=true, libperl=libperl.so.5.8.4 gnulibc_version='2.3.2' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT Built under linux Compiled at Mar 8 2005 19:51:48 @INC: /etc/perl /usr/local/lib/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .
I looked into some of the PASS reports on cpantesters and found that they all only PASS because they skip the test for some reason. I have now tested 2 times with PASS and 109 times with FAIL but on the cpantesters page you do not see the count because we do not send duplicates.
From: WRW [...] cpan.org
I have released version 2.01 with the change suggested below. On Fri Sep 30 07:31:01 2005, guest wrote: Show quoted text
> (Also seen at >
http://www.issociate.de/board/goto/465877/problem_with_Barcode::Code128.html Show quoted text
> ) > > I unpacked Barcode-Code128-2.00.tar.gz from CPAN, and tried to build. > The tests for install fail as follows, > > deskpro261[mca]46: cd Barcode-Code128-2.00 > deskpro261[mca]47: ls > Changes lib Makefile.PL MANIFEST README t > deskpro261[mca]48: perl Makefile.PL > Checking if your kit is complete... > Looks good > Writing Makefile for Barcode::Code128 > deskpro261[mca]49: make test > cp lib/Barcode/Code128.pm blib/lib/Barcode/Code128.pm > PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" > "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t > t/barcode....ok 2/2 (in cleanup) Unrecognized option (destroy) > for Barcode::Code128 at t/barcode.t line 0 > t/barcode....ok > t/gif........ok 1/0skipped > all skipped: no reason given > t/png........NOK 2 (in cleanup) Unrecognized option (destroy) > for Barcode::Code128 at t/png.t line 0 > t/png........FAILED test 2 > Failed 1/2 tests, 50.00% okay > Failed Test Stat Wstat Total Fail Failed List of Failed >
------------------------------------------------------------------------------- Show quoted text
> t/png.t 2 1 50.00% 2 > 1 test skipped. > Failed 1/3 test scripts, 66.67% okay. 0/4 subtests failed, 100.00% > okay. > make: *** [test_dynamic] Error 255 > deskpro261[mca]50: uname -a > Linux deskpro261 2.6.8-2-686 #1 Mon Jan 24 03:58:38 EST 2005 i686 > GNU/Linux > deskpro261[mca]51: cat /etc/debian_version > 3.1 > deskpro261[mca]52: dpkg -s perl > [...] > Version: 5.8.4-8 > [...] > > This because the object destructor DESTROY is being interpretted by > AUTOLOAD as an option. The CPAN installer will correctly install the > module if you tell it "force install Barcode::Code128". > > Here's a fix to v2.00 that might be suitable for distribution, > > deskpro261[mca]59: diff -u lib/Barcode/Code128.pm{~,} > --- lib/Barcode/Code128.pm~ 2001-05-28 22:39:54.000000000 +0100 > +++ lib/Barcode/Code128.pm 2005-09-30 12:16:58.000000000 +0100 > @@ -286,6 +286,7 @@ > my($self, @args) = @_; > use vars qw($AUTOLOAD); > (my $opt = lc $AUTOLOAD) =~ s/^.*:://; > + return if $opt eq 'destroy'; > $self->option($opt, @args); > } > > > In my code using this module I took a patch-it approach, but this is > rather fragile: > > sub _barcode_pattern { > my ($widg, $data) = @_; > > my $bc = Barcode::Code128->new(); > [...] > my $str = $bc->barcode($data); # string /^[ #]+$/ for light & > dark stripes > > undef $bc; > # Barcode::Code128 v2.00 thinks DESTROY is an invalid > # configuration option, and therefore croaks in its own > # destructor. Null implementation provided below. > > return $str; > } > > # Trickery to fix croaking noise, see above > BEGIN { > no strict 'refs'; > die "About to replace Barcode::Code128::DESTROY - ok in v2.00 > but this is $Barcode::Code128::VERSION" > if *{"Barcode::Code128::DESTROY"}{CODE}; > } > sub Barcode::Code128::DESTROY { } > > I add the null DESTROY method prevents AUTOLOAD being called, after > first checking that I'm not replacing some existing code.
Version 2.01 appears to fix this issue.