Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Attribute-Handlers CPAN distribution.

Report information
The Basics
Id: 40781
Status: resolved
Priority: 0/
Queue: Attribute-Handlers

People
Owner: Nobody in particular
Requestors: rybskej [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.80
Fixed in: (no value)



Subject: Test suite error with Perl 5.6.x
It appears that the syntax used in t/linerep.t is incompatible with Perl 5.6. The attached error report (AH-0.80-perl56-make_test.txt) shows the complete make test result; the specific error is: Invalid SCALAR attribute: SArgs(grumpf) at t/linerep.t line 28 BEGIN failed--compilation aborted at t/linerep.t line 28. It appears Perl 5.6 disallows attributes to be declared until *after* the associated handler subroutine has been declared, in the order that the file is defined. I verified this by simply moving the 'my $bar = ... ' line after the attribute handler sub declaration and commenting out the one test that checks \$bar). This seems to be a consistent issue across all Perl 5.6.x versions (according to CPAN testers). In any case, the intended test works fine if evaluation is explicitly deferred until after the subroutine is declared. The attached patch implements this change: Attribute-Handlers- 0.80.perl56.patch. Module test suite with the patch passes fine for me on Perl 5.6.1, 5.8.8, and 5.10.0.
Subject: Attribute-Handlers-0.80.perl56.patch
diff -ru Attribute-Handlers-0.80/t/linerep.t Attribute-Handlers-0.80.perl56/t/linerep.t --- Attribute-Handlers-0.80/t/linerep.t Sat Oct 25 04:53:18 2008 +++ Attribute-Handlers-0.80.perl56/t/linerep.t Sun Nov 9 13:12:21 2008 @@ -25,13 +25,17 @@ sub foo :Args(bar) {} -my $bar :SArgs(grumpf); +my $ref; +sub myref { $ref = shift; } +my $b; +eval "my \$bar :SArgs(grumpf); \$b = \\\$bar"; +is( $b, $ref, 'referent' ); sub SArgs : ATTR(SCALAR) { my ($package, $symbol, $referent, $attr, $data, $phase, $filename, $linenum) = @_; is( $package, 'main', 'package' ); is( $symbol, 'LEXICAL', 'symbol' ); - is( $referent, \$bar, 'referent' ); + myref($referent); is( $attr, 'SArgs', 'attr' ); is( ref $data, 'ARRAY', 'data' ); is( $data->[0], 'grumpf', 'data' );
Subject: perl_platform.txt
Download perl_platform.txt
text/plain 2.2k
Summary of my perl5 (revision 5.0 version 6 subversion 1) configuration: Platform: osname=linux, osvers=2.4.17-0.13smp, archname=i386-linux uname='linux daffy.perf.redhat.com 2.4.17-0.13smp #1 smp fri feb 1 10:30:48 est 2002 i686 unknown ' config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dcccdlflags=-fPIC -Dinstallprefix=/usr -Dprefix=/usr -Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Uusethreads -Uuseithreads -Uuselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Di_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=undef usesocks=undef use64bitint=undef use64bitall=undef uselongdouble=undef Compiler: cc='gcc', ccflags ='-fno-strict-aliasing -I/usr/local/include', optimize='-O2 -march=i386 -mcpu=i686', cppflags='-fno-strict-aliasing -I/usr/local/include' ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.2 2.96-109)', 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=4 alignbytes=4, usemymalloc=n, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-lnsl -ldl -lm -lc -lcrypt -lutil perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic' cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: Built under linux Compiled at Apr 1 2002 12:23:22 @INC: /usr/lib/perl5/5.6.1/i386-linux /usr/lib/perl5/5.6.1 /usr/lib/perl5/site_perl/5.6.1/i386-linux /usr/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.6.1/i386-linux /usr/lib/perl5/vendor_perl/5.6.1 /usr/lib/perl5/vendor_perl .
Subject: AH-0.80-perl56-make_test.txt
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(1, 'blib/lib', 'blib/arch')" t/*.t t/constants....... 1..1 ok 1 - If we got here, CHECK didn't fail ok t/data_convert.... 1..8 ok 1 - test1 ok 2 - test2 ok 3 - test3 ok 4 - test4 ok 5 - test5 ok 6 - test6 ok 7 - test7 ok 8 - test8 ok t/linerep......... 1..18 Invalid SCALAR attribute: SArgs(grumpf) at t/linerep.t line 28 BEGIN failed--compilation aborted at t/linerep.t line 28. ok 1 - package ok 2 - symbol ok 3 - referent ok 4 - attr ok 5 - data ok 6 - data ok 7 - phase ok 8 - filename ok 9 - linenum Dubious, test returned 255 (wstat 65280, 0xff00) Failed 9/18 subtests t/multi........... 1..54 ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 ok 8 ok 9 ok 10 ok 11 ok 12 ok 13 ok 14 ok 15 ok 16 ok 17 ok 18 ok 19 ok 20 ok 21 ok 22 ok 23 ok 24 ok 25 ok 26 ok 27 ok 28 ok 29 ok 30 ok 31 ok 32 ok 33 ok 34 ok 35 ok 36 ok 37 ok 38 ok 39 ok 40 ok 41 ok 42 ok 43 ok 44 ok 45 ok 46 # SKIP lexicals are not runtime prior to 5.8 ok 47 # SKIP does not work with perl prior to 5.8 ok 48 ok 49 ok 50 ok 51 ok 52 # SKIP , no difference between lexical handlers and normal handlers prior to 5.8 ok 53 # phase variance ok 54 ok Test Summary Report ------------------- t/linerep (Wstat: 65280 Tests: 9 Failed: 0) Non-zero exit status: 255 Parse errors: Bad plan. You planned 18 tests but ran 9. Files=4, Tests=72, 0 wallclock secs ( 0.00 usr 0.02 sys + 0.01 cusr 0.14 csys = 0.17 CPU) Result: FAIL Failed 1/4 test programs. 0/72 subtests failed. make: *** [test_dynamic] Error 11
Hi, thanks for the patch. I applied it and made a new CPAN release (0.81). Best regards, Steffen


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

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.