Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make install needs write permission in build directory #4235

Open
p5pRT opened this issue Jul 23, 2001 · 4 comments
Open

make install needs write permission in build directory #4235

p5pRT opened this issue Jul 23, 2001 · 4 comments

Comments

@p5pRT
Copy link

p5pRT commented Jul 23, 2001

Migrated from rt.perl.org#7321 (status was 'open')

Searchable as RT7321$

@p5pRT
Copy link
Author

p5pRT commented Jul 23, 2001

From @Abigail

Created by @Abigail

Some time ago, I reported that 'make install' needs write permission to
certain files/directories. This makes it harder to do the installation
under a different id that the actual building and testing. This problem
was fixed after I reported it.

Unfortunally, the problem has cropped up again in 5.7.2. Write permission
is needed in the build directory, the lib subdirectory and to the file
lib/Config.pm.

If would be nice if the previous situation could be restored.

Abigail

Perl Info

Flags:
    category=install
    severity=high

Site configuration information for perl v5.7.2:

Configured by abigail at Mon Jul 23 14:16:42 CEST 2001.

Summary of my perl5 (revision 5.0 version 7 subversion 2) configuration:
  Platform:
    osname=linux, osvers=2.4.5, archname=i686-linux-64int
    uname='linux hermione 2.4.5 #6 fri jun 22 01:38:20 pdt 2001 i686 unknown '
    config_args='-ds -Dprefix=/opt/devperl -Doptimize=-g -Dusedevel -Duse64bitint'
    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=define use64bitall=undef uselongdouble=undef
  Compiler:
    cc='cc', ccflags ='-Wall -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -I/opt/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
    optimize='-g',
    cppflags='-Wall -DDEBUGGING -fno-strict-aliasing -I/usr/local/include -I/opt/local/include'
    ccversion='', gccversion='2.95.3 20010315 (release)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=4, usemymalloc=n, prototype=define, bincompat5005=define
  Linker and Libraries:
    ld='cc', ldflags =' -L/usr/local/lib -L/opt/local/lib'
    libpth=/usr/local/lib /opt/local/lib /lib /usr/lib
    libs=-lnsl -lndbm -lgdbm -ldl -lm -lc -lcrypt -lutil
    perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
    libc=/lib/libc-2.2.3.so, so=so, useshrplib=false, libperl=libperl.a
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
    cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib -L/opt/local/lib'

Locally applied patches:
    


@INC for perl v5.7.2:
    /home/abigail/Perl
    /home/abigail/Sybase
    /opt/devperl/lib/5.7.2/i686-linux-64int
    /opt/devperl/lib/5.7.2
    /opt/devperl/lib/site_perl/5.7.2/i686-linux-64int
    /opt/devperl/lib/site_perl/5.7.2
    /opt/devperl/lib/site_perl
    .


Environment for perl v5.7.2:
    HOME=/home/abigail
    LANG (unset)
    LANGUAGE (unset)
    LC_ALL=POSIX
    LD_LIBRARY_PATH=/home/abigail/Lib:/usr/local/lib:/usr/lib:/lib:/usr/X11R6/lib:/opt/gnome/lib
    LOGDIR (unset)
    PATH=/home/abigail/Bin:/opt/perl/bin:/usr/local/bin:/usr/local/X11/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/games:/opt/povray/bin:/opt/gnome/bin:/opt/opera/bin:/usr/share/texmf/bin:/opt/Acrobat4/bin
    PERL5LIB=/home/abigail/Perl:/home/abigail/Sybase
    PERLDIR=/opt/perl
    PERL_BADLANG (unset)
    SHELL=/usr/bin/bash


@p5pRT
Copy link
Author

p5pRT commented Nov 13, 2003

From david_wallis@bmc.com

Created by dawallis@gyoza.bmc.com

'make install' should not attempt to change any file or directory
that has previously been created by 'make'. Both AIX and HPUX
installs attempt to rebuild Dynaloader.a, and possibly other
files. Not only is this unnecessary because Dynaloader is already
up to date, but it also causes permission problems​:

If I have changed to a different userid for the install, I probably
don't have permission to make such changes any more. (Remember that
root has NO PRIVILEGES on an NFS filesystem as a general rule.)

Also, remember that developers may or may not have the password to
root on their build machines, which causes problems creating perl
to be included in other products.

Perl Info

Flags:
    category=install
    severity=low

Site configuration information for perl v5.8.2:

Configured by dawallis at Tue Nov 11 15:05:53 PST 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
  Platform:
    osname=aix, osvers=4.3.2.0, archname=aix
    uname='aix gyoza 3 4 000176344c00 '
    config_args='-de -Dprefix=/usr/nc'
    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 ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE
-qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -I/usr/local/include
-I/opt/gnu/include -q32 -D_LARGE_FILES -qlonglong',
    optimize='-O',
    cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384
-qnoansialias -DUSE_NATIVE_DLOPEN -I/usr/local/include -I/opt/gnu/include'
    ccversion='5.0.1.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=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='ld', ldflags =' -brtl -L/usr/local/lib -L/opt/gnu/lib -b32'
    libpth=/usr/local/lib /opt/gnu/lib /lib /usr/lib /usr/ccs/lib
    libs=-lbind -lnsl -ldbm -ldl -lld -lm -lcrypt -lc -lbsd
    perllibs=-lbind -lnsl -ldl -lld -lm -lcrypt -lc -lbsd
    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:/usr/nc/lib/perl5/5.8.2/aix/CORE/perl.exp'
    cccdlflags=' ', lddlflags=' -bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp
-bE:$(BASEEXT).exp -bnoentry -lc -L/usr/local/lib -L/opt/gnu/lib'

Locally applied patches:
    


@INC for perl v5.8.2:
    /usr/nc/lib/perl5/5.8.2/aix
    /usr/nc/lib/perl5/5.8.2
    /usr/nc/lib/perl5/site_perl/5.8.2/aix
    /usr/nc/lib/perl5/site_perl/5.8.2
    /usr/nc/lib/perl5/site_perl
    .


Environment for perl v5.8.2:
    HOME=/home/dawallis
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LIBPATH (unset)
    LOGDIR (unset)
 
PATH=/usr/nc/bin:/usr/vac/bin:/opt/gnu/bin:/ESG_IMAGES/PATROL_EM/.patrolem_t
ools/AIX:/ESG_IMAGES/PATROL_EM/.patrolem_tools/common:/opt/SUNWspro/bin:/usr
/ccs/bin:/sanjose/continuus/ccm62/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/sbin
:.
    PERL_BADLANG (unset)
    SHELL=/usr/bin/ksh

@p5pRT
Copy link
Author

p5pRT commented Nov 13, 2003

From @eserte

"david_wallis@​bmc.com (via RT)" <perlbug-followup@​perl.org> wrote​:

# New Ticket Created by david_wallis@​bmc.com
# Please include the string​: [perl #24486]
# in the subject line of all future correspondence about this issue.
# <URL​: http​://rt.perl.org/rt2/Ticket/Display.html?id=24486 >

This is a bug report for perl from dawallis@​gyoza.bmc.com,
generated with the help of perlbug 1.34 running under perl v5.8.2.

-----------------------------------------------------------------
[Please enter your report here]

'make install' should not attempt to change any file or directory
that has previously been created by 'make'. Both AIX and HPUX
installs attempt to rebuild Dynaloader.a, and possibly other
files. Not only is this unnecessary because Dynaloader is already
up to date, but it also causes permission problems​:

If I have changed to a different userid for the install, I probably
don't have permission to make such changes any more. (Remember that
root has NO PRIVILEGES on an NFS filesystem as a general rule.)

Also, remember that developers may or may not have the password to
root on their build machines, which causes problems creating perl
to be included in other products.

Here's some analysis of the problem. The blibdirs sections of DynaLoader's
Makefile looks like this on my system​:

blibdirs :​:
  $(NOECHO) $(MKPATH) \
  $(INST_LIBDIR) $(INST_AUTODIR) \
  $(INST_ARCHAUTODIR) $(INST_BIN) \
  $(INST_SCRIPT) $(INST_MAN1DIR) \
  $(INST_MAN3DIR)
  $(NOECHO) $(CHMOD) 755 \
  $(INST_LIBDIR) $(INST_AUTODIR) \
  $(INST_ARCHAUTODIR) $(INST_BIN) \
  $(INST_SCRIPT) $(INST_MAN1DIR) \
  $(INST_MAN3DIR)
  $(NOECHO) $(TOUCH) blibdirs

As it stands, this rule gets always fired in a static DynaLoader
build. Maybe it would be better if ExtUtils​::MM_Any​::blibdirs spit
out something like​:

blibdirs :​: $(INST_LIBDIR) $(INST_AUTODIR) \
  $(INST_ARCHAUTODIR) $(INST_BIN) \
  $(INST_SCRIPT) $(INST_MAN1DIR) \
  $(INST_MAN3DIR)
  $(NOECHO) $(TOUCH) blibdirs

$(INST_LIBDIR) :
  $(NOECHO) $(MKPATH) $(INST_LIBDIR)
  $(NOECHO) $(CHMOD) 755 $(INST_LIBDIR)

$(INST_AUTODIR) :
  $(NOECHO) $(MKPATH) $(INST_AUTODIR)
  $(NOECHO) $(CHMOD) 755 $(INST_AUTODIR)

$(INST_ARCHAUTODIR) :
  $(NOECHO) $(MKPATH) $(INST_ARCHAUTODIR)
  $(NOECHO) $(CHMOD) 755 $(INST_ARCHAUTODIR)

$(INST_BIN) :
  $(NOECHO) $(MKPATH) $(INST_BIN)
  $(NOECHO) $(CHMOD) 755 $(INST_BIN)

$(INST_SCRIPT) :
  $(NOECHO) $(MKPATH) $(INST_SCRIPT)
  $(NOECHO) $(CHMOD) 755 $(INST_SCRIPT)

$(INST_MAN1DIR) :
  $(NOECHO) $(MKPATH) $(INST_MAN1DIR)
  $(NOECHO) $(CHMOD) 755 $(INST_MAN1DIR)

$(INST_MAN3DIR) :
  $(NOECHO) $(MKPATH) $(INST_MAN3DIR)
  $(NOECHO) $(CHMOD) 755 $(INST_MAN3DIR)

This is not perfect, either, because GNU make emits some warnings
about overridden targets ($(INST_ARCHAUTODIR) and $(INST_AUTODIR) are
the same here).

Regards,
  Slaven

--
  __o Slaven Rezic
  _`\<,_ slaven <at> rezic <dot> de
__(_)/ (_)____
______________________________________________________________________________

@p5pRT
Copy link
Author

p5pRT commented Nov 14, 2003

From @schwern

On Thu, Nov 13, 2003 at 01​:09​:08PM +0000, Slaven Rezic wrote​:

Here's some analysis of the problem. The blibdirs sections of DynaLoader's
Makefile looks like this on my system​:

blibdirs :​:
$(NOECHO) $(MKPATH) \
$(INST_LIBDIR) $(INST_AUTODIR) \
$(INST_ARCHAUTODIR) $(INST_BIN) \
$(INST_SCRIPT) $(INST_MAN1DIR) \
$(INST_MAN3DIR)
$(NOECHO) $(CHMOD) 755 \
$(INST_LIBDIR) $(INST_AUTODIR) \
$(INST_ARCHAUTODIR) $(INST_BIN) \
$(INST_SCRIPT) $(INST_MAN1DIR) \
$(INST_MAN3DIR)
$(NOECHO) $(TOUCH) blibdirs

As it stands, this rule gets always fired in a static DynaLoader
build.

If it does then there's something wrong. blibdirs is touched at the end
to avoid a rebuild. $(INST_STATIC) depends on blibdirs so the problem
is likely there. It used to depend on $(INST_ARCHAUTODIR)/.exists.

blibdirs is touched. The .exists files were set to the time of CORE/perl.h.

But none of this seems to really be the problem. Running make with
--debug its noting that "blibdirs has a double colon and no dependencies"
and then proceeding to rebuild it even though blibdirs exists. If I take
away the double colon, no problem. I don't know why make decided it has to
rebuild a file that exists with no dependencies and a double colon. Maybe
because there's no dependencies it can't check if its up-to-date so it
just reruns it to make sure. Doesn't really seem right though.

I need to be able to extend the blibdirs target if I'm going to keep
dir_target() working, so I need that double colon. The work around I
can think of is to have blibdirs depend on something. Like Makefile.PL.

Try this.

--- lib/ExtUtils/MM_Any.pm 10 Nov 2003 08​:34​:41 -0000 1.67
+++ lib/ExtUtils/MM_Any.pm 13 Nov 2003 23​:57​:03 -0000
@​@​ -107,7 +107,7 @​@​
  my @​mkpath = $self-&gt;split_command('$(NOECHO) $(MKPATH)', @​dirs);
  my @​chmod = $self-&gt;split_command('$(NOECHO) $(CHMOD) 755', @​dirs);

- my $make = "\nblibdirs :​: \n";
+ my $make = "\nblibdirs :​: Makefile.PL \n";
  $make .= join "", map { "\t$_\n" } @​mkpath, @​chmod;
  $make .= "\t\$(NOECHO) \$(TOUCH) blibdirs\n\n";

Maybe it would be better if ExtUtils​::MM_Any​::blibdirs spit
out something like​:

blibdirs :​: $(INST_LIBDIR) $(INST_AUTODIR) \
$(INST_ARCHAUTODIR) $(INST_BIN) \
$(INST_SCRIPT) $(INST_MAN1DIR) \
$(INST_MAN3DIR)
$(NOECHO) $(TOUCH) blibdirs

$(INST_LIBDIR) :
$(NOECHO) $(MKPATH) $(INST_LIBDIR)
$(NOECHO) $(CHMOD) 755 $(INST_LIBDIR)

Make can't depend on a directory target. That's what caused the whole
$(INST_LIBDIR)/.exists mess in the first place.

See http​://nntp.x.perl.org/group/perl.makemaker/1481 for details.

--
Michael G Schwern schwern@​pobox.com http​://www.pobox.com/~schwern/
Do not try comedy at home! Milk & Cheese are advanced experts! Attempts at
comedy can be dangerously unfunny!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants