punkish has asked for the wisdom of the Perl Monks concerning the following question:
A couple of days ago I upgraded my Macbook Pro from Mac OS X 10.4.x aka Tiger to Mac OS X 10.5.1 aka Leopard. My laptop had my own version of Perl 5.8.8 installed under /usr/local called as #!/usr/local/bin/perl in my scripts. I had installed it a while back, with 100% of its make test passed.
When I upgraded my operating system, it didn't even occur to me that my personal Perl install would get whacked, but it seems that's what happened. As I started running my scripts, I found none of them would run. Here is a typical script and error msg
---- start test script ----------------------- #!/usr/local/bin/perl -w use strict; use diagnostics; use DBI qw(:sql_types); ... ---- end test script ------------------------- 12:45 AM] ~/Data/ckb$ ./foo.pl Can't locate strict.pm in @INC (@INC contains: /usr/local/lib/perl5/5. +8.8/darwin-2level /usr/local/lib/perl5/5.8.8 /usr/local/lib/perl5/sit +e_perl/5.8.8/darwin-2level /usr/local/lib/perl5/site_perl/5.8.8 /usr/ +local/lib/perl5/site_perl .) at foo.pl line 3. BEGIN failed--compilation aborted at foo.pl line 3. [12:45 AM] ~/Data/ckb$ which perl /usr/local/bin/perl [12:45 AM] ~/Data/ckb$ perl -v This is perl, v5.8.8 built for darwin-2level Copyright 1987-2006, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. [12:46 AM] ~/Data/ckb$ perl -e 'print "hello world\n"'; hello world
At this time I thought that perhaps I had to rebuild my Perl because I had installed Leopard. Gearing up for a few hours of installation cycle, I decided to do just that. But this quickly became a nightmare. My original Perl source distro would break on testing. Typical broken tests were
Failed 5 test scripts out of 932, 99.46% okay. ### Since not all tests were successful, you may want to run some of ### them individually and examine any diagnostic messages they produce +. ### See the INSTALL document's section on "make test". ### You have a good chance to get more information by running ### ./perl harness ### in the 't' directory since most (>=80%) of the tests succeeded. ### You may have to set your dynamic library search path, ### DYLD_LIBRARY_PATH, to point to the build directory: ### setenv DYLD_LIBRARY_PATH `pwd`; cd t; ./perl harness ### DYLD_LIBRARY_PATH=`pwd`; export DYLD_LIBRARY_PATH; cd t; ./perl +harness ### export DYLD_LIBRARY_PATH=`pwd`; cd t; ./perl harness ### for csh-style shells, like tcsh; or for traditional/modern ### Bourne-style shells, like bash, ksh, and zsh, respectively. u=1.41 s=1.56 cu=146.16 cs=27.03 scripts=932 tests=117319 make[2]: *** [_test_tty] Error 1 make[1]: *** [_test] Error 2 make: *** [test] Error 2
Very surprising, because this was the same distro that had installed earlier with 100% tests passed. So I decided to do more testing.
[12:11 AM] ~/Projects/perl-5.8.8$ export DYLD_LIBRARY_PATH=`pwd` [12:20 AM] ~/Projects/perl-5.8.8$ cd t [12:20 AM] ~/Projects/perl-5.8.8/t$ ./perl harness .. comp/colon..................................ok + comp/cpp....................................cc1: error: /usr/local/lib +/perl5/5.8.8: Too many levels of symbolic links FAILED before any test output arrived comp/decl...................................ok .. run/switchp.................................ok + run/switchPx................................cc1: error: /usr/local/lib +/perl5/5.8.8: Too many levels of symbolic links FAILED before any test output arrived run/switcht.................................ok .. op/pwent....................................FAILED test 1 + Failed 1/2 tests, 50.00% okay op/qq.......................................ok .. ../lib/ExtUtils/t/dir_target................ok + ../lib/ExtUtils/t/Embed.....................cc1: error: /usr/local/lib +/perl5/5.8.8/darwin-2level/CORE: Too many levels of symbolic links ../lib/ExtUtils/t/Embed.....................FAILED tests 1-9 + Failed 9/9 tests, 0.00% okay .. # None of your locales were broken. ../lib/locale...............................FAILED test 99 + Failed 1/117 tests, 99.15% okay .. Failed Test Stat Wstat Total Fail Failed List of Faile +d ---------------------------------------------------------------------- +--------- ../lib/ExtUtils/t/Embed.t 9 9 100.00% 1-9 ../lib/locale.t 117 1 0.85% 99 comp/cpp.t ?? ?? % ?? op/pwent.t 2 1 50.00% 1 run/switchPx.t ?? ?? % ?? 59 tests and 242 subtests skipped. Failed 5/996 test scripts, 99.50% okay. 11/117332 subtests failed, 99. +99% okay.
Well, after a lot of futzing around, I discovered that in my older /usr/local/lib/ had been renamed to /usr/local/lib 1/, and a new symbolic link had been created from /usr/local/lib/ --> /usr/local/lib/. I am assuming my Leopard installation did that because I am neither smart enough to do something like that, nor dumb enough to create a circular link. But that did explain the "Too many levels of symbolic links" error. Phew. That still didn't explain the other errors such as locale errors.
Anyhoo... I deleted the symbolic link, and renamed /usr/local/lib 1/ to /usr/local/lib/ and everything started working fine. I haven't tested all my modules and all my scripts, but things mostly seem to be ok again. Well, DBI is working, and that makes me happy more than anything. I would still like to know
Failed Test Stat Wstat Total Fail Failed List of Failed ---------------------------------------------------------------------- +--------- ../lib/locale.t 117 1 0.85% 99 op/pwent.t 2 1 50.00% 1 58 tests and 230 subtests skipped. Failed 2/996 test scripts, 99.80% okay. 2/117361 subtests failed, 100. +00% okay.
Both seem harmless (some esoteric locale is clobbered -- see below) and I guess I could live with them, but would still like to understand why this happened, and why these two tests are now failing that all passed with Tiger.
# # The locale definition # # be_BY.CP1131 # # on your system may have errors because the locale test 99 # failed in that locale.
|
|---|