From DrXyzzy@mediaone.net Sat Sep  4 11:19:35 1999
Return-Path: <DrXyzzy@mediaone.net>
Received: from elmls02.ce.mediaone.net (elmls02.ce.mediaone.net [24.131.128.27])
	by hub.freebsd.org (Postfix) with ESMTP id 390AD1505A
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  4 Sep 1999 11:19:32 -0700 (PDT)
	(envelope-from DrXyzzy@mediaone.net)
Received: from gamera.hws (rm01-24-131-181-199.ce.mediaone.net [24.131.181.199])
	by elmls02.ce.mediaone.net (8.8.7/8.8.7) with ESMTP id NAA18514
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 4 Sep 1999 13:19:33 -0500 (CDT)
Received: (from hal@localhost)
	by gamera.hws (8.9.3/8.9.3) id NAA01746;
	Sat, 4 Sep 1999 13:19:43 -0500 (CDT)
	(envelope-from DrXyzzy@mediaone.net)
Message-Id: <199909041819.NAA01746@gamera.hws>
Date: Sat, 4 Sep 1999 13:19:43 -0500 (CDT)
From: drxyzzy@mediaone.net
Reply-To: drxyzzy@mediaone.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: can't install perl module as non root
X-Send-Pr-Version: 3.2

>Number:         13575
>Category:       misc
>Synopsis:       perl Makefile.PL LIB=~/lib;make install fails
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep  4 11:20:01 PDT 1999
>Closed-Date:    Sat Sep 4 18:36:53 PDT 1999
>Last-Modified:  Sat Sep  4 18:40:01 PDT 1999
>Originator:     hws
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
>Environment:

FreeBSD-3.2-RELEASE and the stock Perl 5.005_03.
Module Storable.pm (version Storable-0.6@4.tar.gz)

>Description:

It should be possible to install a standard Perl module without
root privileges. This is documented in the Perl Cookbook and works
as advertised in OpenBSD-2.5 (recent snap) which also bundles Perl
5.005_03, but it fails with FreeBSD.

>How-To-Repeat:

Login as non superuser.
mkdir ~/lib
tar -xvzf Storable-0.6@4.tar.gz
cd Storable-0.6@4
# LIB value should allow non-root install to local dir
perl Makefile.PL LIB=~/lib
make
make test
make install

"make test" succeeds. "make install" fails with the following error:

mkdir /usr/local/lib/perl5/5.00503: Permission denied at /usr/libdata/perl/5.00503/ExtUtils/Install.pm line 57
*** Error code 2

>Fix:
	
	


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: chris 
State-Changed-When: Sat Sep 4 11:38:37 PDT 1999 
State-Changed-Why:  
This is not a FreeBSD problem. 

From: Chris Costello <chris@calldei.com>
To: drxyzzy@mediaone.net
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: misc/13575: can't install perl module as non root
Date: Sat, 04 Sep 1999 13:40:47 -0500

 On Sat, Sep 04, 1999, drxyzzy@mediaone.net wrote:
 > Login as non superuser.
 > mkdir ~/lib
 > tar -xvzf Storable-0.6@4.tar.gz
 > cd Storable-0.6@4
 > # LIB value should allow non-root install to local dir
 > perl Makefile.PL LIB=~/lib
 
    Place `LIB' at the _beginning_ of the line.
 
    In any case, this is a problem with `Makefile.PL' in your
 module, not FreeBSD.
 
 -- 
 |Chris Costello <chris@calldei.com>
 |The next generation of computers will have a "Warranty Expired" interrupt.
 `--------------------------------------------------------------------------
 

From: hws <DrXyzzy@mediaone.net>
To: chris@calldei.com
Cc: drxyzzy@mediaone.net, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: misc/13575: can't install perl module as non root
Date: 04 Sep 1999 13:58:21 -0500

 Chris Costello <chris@calldei.com> writes:
 
 > On Sat, Sep 04, 1999, drxyzzy@mediaone.net wrote:
 > > Login as non superuser.
 > > mkdir ~/lib
 > > tar -xvzf Storable-0.6@4.tar.gz
 > > cd Storable-0.6@4
 > > # LIB value should allow non-root install to local dir
 > > perl Makefile.PL LIB=~/lib
 > 
 >    Place `LIB' at the _beginning_ of the line.
 
 Same thing happens with LIB at beginning of line.
 
 I suspect FreeBSD cruft relating to moving perl5 from /usr/local to
 /usr/libdata since the error arises from FreeBSD perl Wanting to
 scribble in /usr/local.
 
 >    In any case, this is a problem with `Makefile.PL' in your
 > module, not FreeBSD.
 
 It's not my module, it's a commonly used module from CPAN.
 
 The problem does not happen with same version of Perl, same module
 (same Makefile.PL) when running on OpenBSD. This suggests, but does
 not prove, that it is a problem with the perl binary or supporting
 libs shipped with FreeBSD.
 

From: hws <DrXyzzy@mediaone.net>
To: chris@calldei.com
Cc: drxyzzy@mediaone.net, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: misc/13575: can't install perl module as non root
Date: 04 Sep 1999 14:16:08 -0500

 Chris Costello <chris@calldei.com> writes:
 
 > On Sat, Sep 04, 1999, drxyzzy@mediaone.net wrote:
 > > Login as non superuser.
 > > mkdir ~/lib
 > > tar -xvzf Storable-0.6@4.tar.gz
 > > cd Storable-0.6@4
 > > # LIB value should allow non-root install to local dir
 > > perl Makefile.PL LIB=~/lib
 > 
 >    Place `LIB' at the _beginning_ of the line.
 
 man ExtUtils::MakeMaker 
 
 perl Makefile.PL NAME=VALUE... is supported for setting Makefile
 Attributes and Paramters.
 
 
State-Changed-From-To: closed->open 
State-Changed-By: fenner 
State-Changed-When: Sat Sep 4 17:05:44 PDT 1999 
State-Changed-Why:  
This is a real problem, and is definitely related to how perl is installed 
on FreeBSD.  It may be a bug in ExtUtils::MM_Unix.pm, but it is still 
something that we need to look into. 

From: Bill Fenner <fenner@research.att.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: misc/13575: perl Makefile.PL LIB=~/lib;make install fails
Date: Sat, 4 Sep 1999 18:12:53 -0700

 I created the following Makefile.PL:
 
 use ExtUtils::MakeMaker;
 WriteMakefile( NAME => "Foo::Bar" );
 
 and created a Bar.pm with a little bit of pod, and ran "perl Makefile.PL
 LIB=/tmp" to create a Makefile.
 
 I found some interesting things:
 
 - Perl on 3.2-STABLE creates Makefiles with "OSVERS = 4.0-current"
   and ccsymbols including __FreeBSD__=4 and __FreeBSD_cc_version=400002.
 - The machine-specific identifier in path names is sometimes "mach" and
   sometimes "i386-freebsd", where on other systems it is consistent.
 
 And, in fact, I think I found the bug.  My hypothesis is that the
 difference between the two machines is not that one is OpenBSD and
 one is FreeBSD; rather, the one on which installation works already
 has some perl modules installed in /usr/local/lib/perl5 and the one
 on which it doesn't doesn't.  When I did a "make install", everything
 worked fine until I moved /usr/local/lib/perl5 out of the way.
 
 fenestro# mv perl5 perl5.not
 fenestro# suspend
 
 Suspended
 fenestro% make install
 mkdir /usr/local/lib/perl5: Permission denied at /usr/libdata/perl/5.00503/ExtUtils/Install.pm line 57
 *** Error code 2
 su
 fenestro# mv perl5.not perl5
 fenestro# suspend
 
 Suspended
 fenestro% make install
 Warning: You do not have permissions to install into /usr/local/lib/perl5/5.00503/man/man3 at /usr/libdata/perl/5.00503/ExtUtils/Install.pm line 61.
 Skipping /tmp/i386-freebsd/auto/Storable/Storable.so (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/Storable.bs (unchanged)
 Files found in blib/arch --> Installing files in blib/lib into architecture dependend library tree!
 Skipping /tmp/i386-freebsd/auto/Storable/store.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/nstore.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/_store.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/store_fd.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/nstore_fd.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/_store_fd.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/freeze.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/nfreeze.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/_freeze.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/retrieve.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/retrieve_fd.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/thaw.al (unchanged)
 Skipping /tmp/i386-freebsd/auto/Storable/autosplit.ix (unchanged)
 Skipping /tmp/i386-freebsd/Storable.pm (unchanged)
 Installing /usr/local/lib/perl5/5.00503/man/man3/Storable.3
 Writing /tmp/i386-freebsd/auto/Storable/.packlist
 Appending installation info to /tmp/i386-freebsd/perllocal.pod
 fenestro% 
 
 
 This appears to be a bug in ExtUtils::Install, and so should be reported
 to the Perl folks, not the FreeBSD folks.
 
   Bill
 
State-Changed-From-To: open->closed 
State-Changed-By: fenner 
State-Changed-When: Sat Sep 4 18:36:53 PDT 1999 
State-Changed-Why:  
Ok, I've convinced myself that it's a perl problem (in ExtUtils::MM_Unix 
or ExtUtils::Install), which is clearly exacerbated by FreeBSD's use 
of different prefixes when configuring (but not caused by it). 

From: Bill Fenner <fenner@research.att.com>
To: freebsd-gnats-submit@freebsd.org
Cc:  
Subject: Re: misc/13575: perl Makefile.PL LIB=~/lib;make install fails
Date: Sat, 4 Sep 1999 18:36:23 -0700

 BTW, MakeMaker has a bunch of bugs.  It seems to try to take its idea of
 what the paths from Config.pm should be and use s/// to turn them into
 something else, but
 
 a) it seems to get the defaults wrong -- a perl installation with
 no defaults overridden at configure time (i.e. Config.pm has
 "config_args=''") tries some things that will work:
 
 prefixify INSTALLPRIVLIB (/usr/local/lib/perl5/5.00503), with /usr/local/lib/perl5 -> $(PREFIX)/lib/perl5
 prefixify INSTALLARCHLIB (/usr/local/lib/perl5/5.00503/i686-linux-thread), with /usr/local/lib/perl5 -> $(PREFIX)/lib/perl5
 
 and some that won't:
 
 prefixify INSTALLMAN1DIR (/usr/local/man/man1), with /usr/local/lib/perl5/man -> $(PREFIX)/lib/perl5/man
 prefixify INSTALLMAN3DIR (/usr/local/lib/perl5/5.00503/man/man3), with /usr/local/lib/perl5/man -> $(PREFIX)/lib/perl5/man
 
 b) if you give args to Configure, like the FreeBSD build does, MakeMaker
 doesn't take them into account so does even more things wrong:
 
 prefixify INSTALLPRIVLIB (/usr/libdata/perl/5.00503), with /usr/lib/perl5 -> $(PREFIX)/lib/perl5
 prefixify INSTALLARCHLIB (/usr/libdata/perl/5.00503/mach), with /usr/lib/perl5 -> $(PREFIX)/lib/perl5
 prefixify INSTALLSITELIB (/usr/local/lib/perl5/site_perl/5.005), with /usr/lib/perl5 -> $(PREFIX)/lib/perl5
 prefixify INSTALLSITEARCH (/usr/local/lib/perl5/site_perl/5.005/i386-freebsd), with /usr/lib/perl5 -> $(PREFIX)/lib/perl5
 prefixify INSTALLMAN1DIR (/usr/local/man/man1), with /usr/lib/perl5/man -> $(PREFIX)/lib/perl5/man
 prefixify INSTALLMAN3DIR (/usr/local/lib/perl5/5.00503/man/man3), with /usr/lib/perl5/man -> $(PREFIX)/lib/perl5/man
 
 None of these substitutions can work.
 
 
 (this output is from instrumenting ExtUtils::MM_Unix prefixify() with
 print "prefixify $var ($self->{uc $var}), with $sprefix -> $rprefix\n";
 )
 
 I'm not perl-errific enough to want to get into MakeMaker deeply enough
 to try to fix this, especially since it seems more or less fundamentally
 broken.  Perhaps someone with more spare time and/or more perl energy
 can =)
 
   Bill
 
>Unformatted:
