Front page | perl.perl5.porters |
Postings from April 2003
[perl #22034] AutoSplit detection of AutoLoader use fails in certain situations
From:
James.FitzGibbon
Date:
April 25, 2003 09:58
Subject:
[perl #22034] AutoSplit detection of AutoLoader use fails in certain situations
Message ID:
rt-22034-55866.9.93141062538555@bugs6.perl.org
# New Ticket Created by "James.FitzGibbon"
# Please include the string: [perl #22034]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22034 >
This is a bug report for perl from james.fitzgibbon@target.com,
generated with the help of perlbug 1.34 running under perl v5.8.0.
-----------------------------------------------------------------
When AutoSplit::autosplit_file() is called, it uses several regular
expressions to determine if a module uses AutoLoader. If one of the regex
match, then the module is autosplit, otherwise it is not.
The regex used are:
/^\s*(use|require)\s+AutoLoader\b/
/\bISA\s*=.*\bAutoLoader\b/
But this does not catch some of the more esoteric ways in which one can
use the AutoLoader, like:
use base qw|AutoLoader|;
or
use if $ENV{PERL_AUTOLOAD_DEVEL}, AutoLoader => 'AUTOLOAD';
While the AutoSplit module does have a way to turn this check off, the
manner in which ExtUtils::Install::pm_to_blib() calls autosplit does not
lend itself to a simple override; one would have to completely override
all of pm_to_blib, or perform some rather funky overrides inside of
(in my case) ExtUtils::MM_Unix. In either case, it's not very elegant.
I suggest that the regex set used to detect the use of AutoLoader be
expanded to match the above two cases. A rather simplistic way of
doing this would be to change the first regex above to:
/^\s*(use|require).+AutoLoader\b/
But this will surely cause some false positives to be created.
An alternative approach which would mitigate the false positive problem
would be to change AutoSplit to 'back out' it's creation of the directories
in lib/auto/ and remove autosplit.ix if no subroutines are found after
__END__ in the module.
Regards.
[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
category=library
severity=medium
---
Site configuration information for perl v5.8.0:
Configured by operapp at Thu Nov 21 10:41:07 CST 2002.
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=aix, osvers=4.3.3.0, archname=aix-thread-multi
uname='aix app3d03 3 4 000ac54f4c00 '
config_args='-Dprefix=/opt/3d -Dinstallprefix=/opt/3d
-Dinstallscript=/opt/3d/bin -Dscriptdir=/opt/3d/bin
-Dlocincpth=/opt/3d/include -Dloclibpth=/opt/3d/lib -Dldflags=-L/opt/3d/lib
-Dcf_email=james.fitzgibbon@target.com
-Dperladmin=james.fitzgibbon@target.com -Ud_dirnamlen -Dusethreads
-Uuselargefiles -Uinstallusrbinperl -Dextras=AtExit CPAN Test::More
Compress::Zlib Archive::Zip Config::IniFiles -des'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define
usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=undef usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc_r', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT
-I/opt/3d/include',
optimize='-O',
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384
-qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -I/opt/3d/include'
ccversion='5.0.2.0', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=4
alignbytes=8, prototype=define
Linker and Libraries:
ld='ld', ldflags ='-L/opt/3d/lib -brtl'
libpth=/opt/3d/lib /lib /usr/lib /usr/ccs/lib
libs=-lbind -lnsl -lgdbm -ldbm -ldl -lld -lm -lpthreads -lc_r -lcrypt
-lbsd -lPW
perllibs=-lbind -lnsl -ldl -lld -lm -lpthreads -lc_r -lcrypt -lbsd -lPW
libc=/lib/libc.a, so=a, useshrplib=false, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='
-bE:/opt/3d/lib/perl5/5.8.0/aix-thread-multi/CORE/perl.exp'
cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp
-bE:$(BASEEXT).exp -bnoentry -lpthreads -lc_r -L/opt/3d/lib'
Locally applied patches:
---
@INC for perl v5.8.0:
/opt/3d/dcdv01/lib/perl5/5.8.0/aix-thread-multi
/opt/3d/dcdv01/lib/perl5/5.8.0
/opt/3d/dcdv01/lib/perl5
/opt/3d/dcdv01/lib/perl5/site_perl/5.8.0/aix-thread-multi
/opt/3d/dcdv01/lib/perl5/site_perl/5.8.0
/opt/3d/dcdv01/lib/perl5/site_perl
/opt/3d/lib/perl5/5.8.0/aix-thread-multi
/opt/3d/lib/perl5/5.8.0
/opt/3d/lib/perl5/site_perl/5.8.0/aix-thread-multi
/opt/3d/lib/perl5/site_perl/5.8.0
/opt/3d/lib/perl5/site_perl
.
---
Environment for perl v5.8.0:
HOME=/home_dir/jfitzgi
LANG=en_US
LANGUAGE (unset)
LC__FASTMSG=true
LD_LIBRARY_PATH=/usr/lib:/lib:/opt/3d/dcdv01/lib:/opt/oracle/product/prodver
s/lib
LIBPATH=/usr/lib:/lib:/opt/3d/dcdv01/lib:/opt/oracle/product/prodvers/lib
LOGDIR (unset)
PATH=/home_dir/jfitzgi/myperl/bin:/opt/3d/bin:/home_dir/jfitzgi/sbin:/home_d
ir/jfitzgi/bin:/sys02/apps/cb54:/opt/3d/dcdv01/sbin:/opt/3d/dcdv01/bin:/opt/
3d/sbin:/opt/3d/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/bin/X11:/opt/orac
le/product/prodvers/bin:/home_dir/jfitzgi:/usr/vac/bin
PERL5LIB=/home_dir/jfitzgi/myperl/lib/perl5:/home_dir/jfitzgi/myperl/lib/per
l5/site_perl:/opt/3d/dcdv01/lib/perl5:/opt/3d/dcdv01/lib/perl5/site_perl
PERL_BADLANG (unset)
SHELL=/home_dir/jfitzgi/bin/tcsh
-
[perl #22034] AutoSplit detection of AutoLoader use fails in certain situations
by James.FitzGibbon