Closed p5pRT closed 20 years ago
In order to upgrade perl on a production server without downtime\, it is necessary to install library files into the library areas for the new perl version before changing the aliases at /usr/bin/perl and /usr/local/bin/perl.
Fortunately this is relatively straightforward in most cases:
perl5.6.0 Makefile.PL make make test make install
This should set up the created Makefile to install into the correct directories. It worked fine in the past\, but does not appear to work now.
In the case of URI-1.10 for example this fails.
chips:/usr/local/src/CPAN/URI/URI-1.10# perl5.6.0 Makefile.PL Writing Makefile for URI chips:/usr/local/src/CPAN/URI/URI-1.10# make Perl 5.00564 required--this is only version 5.00503\, stopped at /usr/local/lib/perl5/5.6.0/ExtUtils/Command.pm line 3. BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.6.0/ExtUtils/Command.pm line 3. BEGIN failed--compilation aborted. make: *** [blib/lib/.exists] Error 255
Modifying the generated Makefile so that PERL and FULLPERL (twice) point to the perl version that ran Makefile.PL allows the install to proceed correctly.
The actual bug appears to be in ExtUtils::MM_Unix (and platform equivalents presumably):
Looking for perl 5 by these names: perl5.6.0 miniperl perl perl5 perl5.6.0 in these dirs: /sbin /bin /usr/sbin /usr/bin /usr/bin/X11 /usr/local/sbin /usr/local/bin /usr/local/bin Checking /sbin/perl5.6.0 Checking /sbin/miniperl Checking /sbin/perl Checking /sbin/perl5 Checking /sbin/perl5.6.0 Checking /bin/perl5.6.0 Checking /bin/miniperl Checking /bin/perl Checking /bin/perl5 Checking /bin/perl5.6.0 Checking /usr/sbin/perl5.6.0 Checking /usr/sbin/miniperl Checking /usr/sbin/perl Checking /usr/sbin/perl5 Checking /usr/sbin/perl5.6.0 Checking /usr/bin/perl5.6.0 Checking /usr/bin/miniperl Checking /usr/bin/perl Executing /usr/bin/perl Using PERL=/usr/bin/perl
The problem is that it searches for /usr/bin/perl before /usr/local/bin/perl5.6.0
This could be corrected by putting the loop-by-name around the loop-by-directory\, currently the other way around.
==========================================================================
==========================================================================
I don't know if this has any unwanted side effects\, but it appears to be in keeping with the intent of the code involved.
Andrew McNaughton
On Thu\, 8 Feb 2001 00:28:33 +1300 (NZDT)\, andrew@tki.org.nz said:
--- MM_Unix.pm.orig Wed Feb 7 17:39:16 2001 +++ MM_Unix.pm Wed Feb 7 17:43:13 2001 @@ -1147\,9 +1147\,9 @@ @$dirs "; } - foreach $dir (@$dirs){ - next unless defined $dir; # $self->{PERL_SRC} may be undefined - foreach $name (@$names){ + foreach $name (@$names){ + foreach $dir (@$dirs){ + next unless defined $dir; # $self->{PERL_SRC} may be undefined my ($abs\, $val); if ($self->file_name_is_absolute($name)) { # /foo/bar $abs = $name;
I recognize patch number 7189 from the repository. It will be part of 5.7.1 and 5.6.1.
Bug can be closed.
Thanks for the report!
\andrew@​tki\.org\.nz writes:
This is a bug report for perl from andrew@sub.internal.cwa.co.nz\, generated with the help of perlbug 1.26 running under perl 5.006.
chips:/usr/local/src/CPAN/URI/URI-1.10# perl5.6.0 Makefile.PL Writing Makefile for URI chips:/usr/local/src/CPAN/URI/URI-1.10# make Perl 5.00564 required--this is only version 5.00503\, stopped at /usr/local/lib/perl5/5.6.0/ExtUtils/Command.pm line 3. BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.6.0/ExtUtils/Command.pm line 3. BEGIN failed--compilation aborted. make: *** [blib/lib/.exists] Error 255
Modifying the generated Makefile so that PERL and FULLPERL (twice) point to the perl version that ran Makefile.PL allows the install to proceed correctly.
The actual bug appears to be in ExtUtils::MM_Unix (and platform equivalents presumably):
Looking for perl 5 by these names: perl5.6.0 miniperl perl perl5 perl5.6.0 in these dirs:
This would all be a lot simpler of $^X was (reliably) a full path. (Which is not to say that we cannot do better without.)
Linux could get that right with readlink("/proc/$$/exe")
Solaris could get something-that-worked with /proc/$$/object/a.out
Do freebsd and other systems have anything similar?
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=freebsd\, osvers=3.4-stable\, archname=i386-freebsd uname='freebsd sub.internal.cwa.co.nz 3.4-stable freebsd 3.4-stable #1: tue may 16 20:48:22 nzst 2000 andrew@sub.internal.cwa.co.nz:usrsrcsyscompilesub-2000012101 i386 '
On Wed\, Feb 07\, 2001 at 06:12:41PM +0000\, Nick Ing-Simmons wrote:
\andrew@​tki\.org\.nz writes:
The actual bug appears to be in ExtUtils::MM_Unix (and platform equivalents presumably):
Looking for perl 5 by these names: perl5.6.0 miniperl perl perl5 perl5.6.0 in these dirs:
This would all be a lot simpler of $^X was (reliably) a full path. (Which is not to say that we cannot do better without.)
Linux could get that right with readlink("/proc/$$/exe")
Solaris could get something-that-worked with /proc/$$/object/a.out
Do freebsd and other systems have anything similar?
As best I could tell freebsd is nice and already puts the full path of the "shell" in argv[0]
nick@roast [test]$ cat argv.pl #!/usr/bin/perl -w print "$^X\n"; print "$0\n"; nick@roast [test]$ ./argv.pl /usr/bin/perl ./argv.pl
linux 2.2 gives me
nick@liam [test]$ ./argv.pl perl ./argv.pl
linux 2.4 gives me
nick@fruitbat [8692-src]$ /mnt/liam/nick/test/argv.pl /usr/bin/perl /mnt/liam/nick/test/argv.pl
[Should be same perl binary and same /bin/sh from Debain]
Hmm. FreeBSD 4 is "better" than Linux 2.2 here
Nicholas Clark
Nicholas Clark \nick@​ccl4\.org writes:
Linux could get that right with readlink("/proc/$$/exe")
Solaris could get something-that-worked with /proc/$$/object/a.out
Do freebsd and other systems have anything similar?
As best I could tell freebsd is nice and already puts the full path of the "shell" in argv[0]
nick@roast [test]$ cat argv.pl #!/usr/bin/perl -w print "$^X\n"; print "$0\n"; nick@roast [test]$ ./argv.pl /usr/bin/perl ./argv.pl
Which while useful to know\, does not cover the
perl Makefile.PL case.
What does
perl argv.pl
print on freebsd ?
linux 2.2 gives me
nick@liam [test]$ ./argv.pl perl ./argv.pl
linux 2.4 gives me
nick@fruitbat [8692-src]$ /mnt/liam/nick/test/argv.pl /usr/bin/perl /mnt/liam/nick/test/argv.pl n b> [Should be same perl binary and same /bin/sh from Debain]
Hmm. FreeBSD 4 is "better" than Linux 2.2 here
Nicholas Clark
On Wed\, Feb 07\, 2001 at 10:07:11PM +0000\, nick@ing-simmons.net wrote:
Which while useful to know\, does not cover the
perl Makefile.PL case.
What does
perl argv.pl
print on freebsd ?
perl argv.pl
D'oh for me not thinking of testing that one. (just like 2.4.0 linux for "perl argv.pl")
Nicholas Clark
On Wed\, 7 Feb 2001\, Nick Ing-Simmons wrote:
Looking for perl 5 by these names: perl5.6.0 miniperl perl perl5 perl5.6.0 in these dirs:
This would all be a lot simpler of $^X was (reliably) a full path. (Which is not to say that we cannot do better without.)
Linux could get that right with readlink("/proc/$$/exe")
Solaris could get something-that-worked with /proc/$$/object/a.out
Do freebsd and other systems have anything similar?
/proc/$$/file acts like a hard link\, but given that the original 'perlXXX Makefile.PL' will have terminated\, /proc/$$ will be gone when you come to the make. You can get the inode number with `ls -i /proc/$$/file`\, but I'm not sure how you'd get to the original file name with that. IT provides verification that you've got it right I suppose.
lsof can be used to find the path name\, but it's not a given that it's installed. It's code would however be a source of techniques that could be applied on any given platform.
Andrew
-- Andrew McNaughton Te Kete Ipurangi: The Online Learning Centre andrew@tki.org.nz Ph: 64 4 382 6500 Fax: 64 4 382 6509 Mobile: 021 323 076
PO Box 19-098 Wellington\, NZ http://www.tki.org.nz/
Migrated from rt.perl.org#5773 (status was 'resolved')
Searchable as RT5773$