Front page | perl.perl5.porters |
Postings from May 2003
[perl #22077] Module Loading on Case-Insensitive File Systems
Thread Next
From:
David Wheeler
Date:
May 1, 2003 06:00
Subject:
[perl #22077] Module Loading on Case-Insensitive File Systems
Message ID:
rt-22077-56313.13.6054225869425@bugs6.perl.org
# New Ticket Created by David Wheeler
# Please include the string: [perl #22077]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22077 >
This is a bug report for perl from david@kineticode.com,
generated with the help of perlbug 1.34 running under perl v5.8.0.
-----------------------------------------------------------------
An issue has just come up with Stas Bekman's release of Apache::Test. It turns
out that on case-insensitive file systems, such as HFS+ on Mac OS X, and
whatever Win32 runs these days, Perl can load the wrong module. For example,
Stas' new module is called "Apache::Test". Scripts that load it, such as
Makefile.PL in libapreq 1.2 (http://httpd.apache.org/~joes/), do so like this:
use constant HAS_APACHE_TEST => eval {require Apache::Test};
The problem, however, is that those of us who have already installed mod_perl
1.x have a copy of "Apache::test" installed already. Note the different case:
"Apache::Test" vs. "Apache::test". It turns out that, because the mod_perl
installer installs Apache::test in the platform directory (e.g.,
site_perl/5.8.0/darwin/Apache/test.pm on my system), while Apache::Test gets
installed in the usual Perl library directory (e.g., on my system,
site_perl/5.8.0/Apache/Test.pm), because of the order of @INC (see below),
Apache::test actually gets loaded instead of Apache::Test! Even worse, because
Apache::test has no version number CPANPLUS seems to think that Apache::Test
is up-to-date, even though, technically, it's not installed at all!
This appears to be because although HFS+ is a case-insensitive file system, it
is also a case-preserving file system, and Perl doesn't necessarily know
that. What would be great is if, on case-insensitive but case-preserving file
systems, Perl was smart enough to check the case of any files it finds on the
file system before actually loading them. FWIW, the `find` utility that comes
with Mac OS X seems to be able to tell the difference:
mercury# find . -name "Test.pm"
./5.8.0/Test.pm
./site_perl/5.8.0/Apache/Test.pm
./site_perl/5.8.0/Devel/Profiler/Test.pm
./site_perl/5.8.0/HTTP/WebTest/Test.pm
./site_perl/5.8.0/SOAP/Test.pm
./site_perl/5.8.0/XMLRPC/Test.pm
mercury# find . -name "test.pm"
./site_perl/5.8.0/darwin/Apache/test.pm
./site_perl/5.8.0/Mail/Mailer/test.pm
Note that when I told `find` to search for "test.pm" it didn't find any
"Test.pm" files, and when I told it to search for "Test.pm" it didn't find any
"test.pm" files. So it pays attention to the case you tell it to look for when
it searches the file system. Theoretically, Perl can do this, too, at least on
case-insensitive file systems that are also case-preserving. Or so I would
think.
Stas and I are discussing other strategies for overcoming this problem. But if
there was some way to tell Perl to do a case-sensitive require, that would be
preferable. There isn't some kind of pragma or something to correct this
behavior, is there?
Thanks!
David
-----------------------------------------------------------------
---
Flags:
category=core
severity=low
---
Site configuration information for perl v5.8.0:
Configured by david at Sat Dec 21 18:17:50 PST 2002.
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=darwin, osvers=6.3, archname=darwin
uname='darwin mercury.local. 6.3 darwin kernel version 6.3: sat dec 14 03:11:25 pst 2002; root:xnuxnu-344.23.obj~4release_ppc power macintosh powerpc '
config_args='-des -Uinstallusrbinperl -Dprefix=/usr/local -Dperladmin=david@kineticode.com -Dcf_email=david@kineticode.com'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include',
optimize='-O3',
cppflags='-no-cpp-precomp -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='3.1 20020420 (prerelease)', 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=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -flat_namespace -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib
libs=-lm -lc
perllibs=-lm -lc
libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -flat_namespace -bundle -undefined suppress -L/usr/local/lib'
Locally applied patches:
---
@INC for perl v5.8.0:
/usr/local/lib/perl5/5.8.0/darwin
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/darwin
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
.
---
Environment for perl v5.8.0:
DYLD_LIBRARY_PATH (unset)
HOME=/Users/david
LANG=en_US
LANGUAGE (unset)
LC_ALL=C
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/david:/usr/local/bin:/sbin:/usr/sbin:/Developer/Tools//Users/david/bin:/sbin:/usr/sbin:/usr/local/sbin:/Developer/Tools:/Users/david/bin::/usr/local/pgsql/bin:/usr/local/jakarta-ant-1.4.1/bin
PERL5LIB=:/usr/local/bricolage/lib:/Users/david/dev/perl/myco/classes
PERL_BADLANG (unset)
SHELL=/bin/zsh
Thread Next
-
[perl #22077] Module Loading on Case-Insensitive File Systems
by David Wheeler