Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.91k stars 542 forks source link

make rebuilds perl everytime #8704

Closed p5pRT closed 16 years ago

p5pRT commented 17 years ago

Migrated from rt.perl.org#41058 (status was 'resolved')

Searchable as RT41058$

p5pRT commented 17 years ago

From perlbug@plan9.de

Created by perlbug@plan9.de

Since using gcc-4\, "make" in the perl diretcory re-builds perl again everytime.

The reason is that the build directory gets listed as one of the dependencies for every file\, and that directory changes on each compile\, so everythine is remade again and again.

The indirect reason is thta makedepend gets that directory form cpp output\, which starts like this​:

# 1 "\" # 1 "/root/cvt/perl/perl-5.8.x//"

Why gcc-4 (as opposed to gcc-3) includes this\, I have no idea\, but I would suggest ignoring any directories when automatically extratcing dependencies for that reason.

Perl Info ``` Flags: category=core severity=low This perlbug was built using Perl v5.8.8 - Thu Oct 26 14:18:28 CEST 2006 It is being executed now by Perl v5.8.8 - Sat Dec 9 14:03:08 CET 2006. Site configuration information for perl v5.8.8: Configured by Marc Lehmann at Sat Dec 9 14:03:08 CET 2006. Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.6.17.6, archname=amd64-linux uname='linux cerebro 2.6.17.6 #1 smp fri oct 20 19:28:13 cest 2006 x86_64 gnulinux ' config_args='-Duselargefiles -Dxxxxuse64bitint -Uuse64bitall -Dusemymalloc=n -Dcc=gcc -Dccflags=-DPERL_DONT_CREATE_GVSV -ggdb -Dcppflags=-DPERL_DONT_CREATE_GVSV -D_GNU_SOURCE -I/opt/include -Doptimize=-O4 -march=opteron -mtune=opteron -funroll-loops -fno-strict-aliasing -Dcccdlflags=-fPIC -Dldflags=-L/opt/perl/lib -L/opt/lib -Dlibs=-ldl -lm -lcrypt -Darchname=amd64-linux -Dprefix=/opt/perl -Dprivlib=/opt/perl/lib/perl5 -Darchlib=/opt/perl/lib/perl5 -Dvendorprefix=/opt/perl -Dvendorlib=/opt/perl/lib/perl5 -Dvendorarch=/opt/perl/lib/perl5 -Dsiteprefix=/opt/perl -Dsitelib=/opt/perl/lib/perl5 -Dsitearch=/opt/perl/lib/perl5 -Dsitebin=/opt/perl/bin -Dman1dir=/opt/perl/man/man1 -Dman3dir=/opt/perl/man/man3 -Dsiteman1dir=/opt/perl/man/man1 -Dsiteman3dir=/opt/perl/man/man3 -Dman1ext=1 -Dman3ext=3 -Dpager=/usr/bin/less -Uafs -Uusesfio -Uusenm -Uuseshrplib -Dd_dosuid -Dusethreads=undef -Duse5005threads=undef -Duseithreads=undef -Dusemultiplicity=undef -Demail=perl-binary@plan9.de -Dcf_email=perl-binary@plan9.de -Dcf_by=Marc Lehmann -Dlocincpth=/opt/perl/include /opt/include -Dmyhostname=localhost -Dmultiarch=undef -Dbin=/opt/perl/bin -Dusedevel -des' 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 usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-DPERL_DONT_CREATE_GVSV -ggdb -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/opt/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O4 -march=opteron -mtune=opteron -funroll-loops -fno-strict-aliasing', cppflags='-DPERL_DONT_CREATE_GVSV -D_GNU_SOURCE -I/opt/include -DPERL_DONT_CREATE_GVSV -ggdb -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/opt/include' ccversion='', gccversion='4.1.2 20061115 (prerelease) (Debian 4.1.1-20)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags ='-L/opt/perl/lib -L/opt/lib -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib libs=-ldl -lm -lcrypt perllibs=-ldl -lm -lcrypt libc=/lib/libc-2.3.6.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.3.6' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -L/opt/perl/lib -L/opt/lib -L/usr/local/lib' Locally applied patches: MAINT28213 @INC for perl v5.8.8: /root/src/sex /opt/perl/lib/perl5 /opt/perl/lib/perl5 /opt/perl/lib/perl5 /opt/perl/lib/perl5 /opt/perl/lib/perl5 . Environment for perl v5.8.8: HOME=/root LANG (unset) LANGUAGE (unset) LC_CTYPE=de_DE.UTF-8 LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/root/s2:/root/s:/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11/bin:/usr/games:/root/src/uunet:. PERL5LIB=/root/src/sex PERL5_CPANPLUS_CONFIG=/root/.cpanplus/config PERLDB_OPTS=ornaments=0 PERL_BADLANG (unset) PERL_UNICODE=EAL SHELL=/bin/bash ```
p5pRT commented 17 years ago

From @doughera88

On Sat\, 9 Dec 2006\, perlbug @​ plan9 . de wrote​:

# New Ticket Created by perlbug@​plan9.de # Please include the string​: [perl #41058] # in the subject line of all future correspondence about this issue. # \<URL​: http​://rt.perl.org/rt3/Ticket/Display.html?id=41058 >

Since using gcc-4\, "make" in the perl diretcory re-builds perl again everytime.

The reason is that the build directory gets listed as one of the dependencies for every file\, and that directory changes on each compile\, so everythine is remade again and again.

The indirect reason is thta makedepend gets that directory form cpp output\, which starts like this​:

# 1 "\" # 1 "/root/cvt/perl/perl-5.8.x//"

Why gcc-4 (as opposed to gcc-3) includes this\, I have no idea\, but I would suggest ignoring any directories when automatically extratcing dependencies for that reason.

I'm afraid I can't reproduce this. I used stock perl-5.8.8 and gcc-4.1.1.

The only relevant thing I see is that your gcc is

gccversion='4\.1\.2 20061115 \(prerelease\) \(Debian 4\.1\.1\-20\)'

while mine is simply

  gccversion='4.1.1'

I guess that the 4.1.2 release will be adding this "feature". Could you send me a few sample lines from your 'makefile' that show such dependencies? I'll see if I can tweak the sed rules in makedepend.SH to ignore them.

Thanks\,

--   Andy Dougherty doughera@​lafayette.edu

p5pRT commented 17 years ago

The RT System itself - Status changed from 'new' to 'open'

p5pRT commented 17 years ago

From @rgarcia

On 12/12/06\, Andy Dougherty \doughera@&#8203;lafayette\.edu wrote​:

I'm afraid I can't reproduce this. I used stock perl-5.8.8 and gcc-4.1.1.

The only relevant thing I see is that your gcc is

gccversion='4\.1\.2 20061115 \(prerelease\) \(Debian 4\.1\.1\-20\)'

while mine is simply

gccversion='4\.1\.1'

I guess that the 4.1.2 release will be adding this "feature". Could you send me a few sample lines from your 'makefile' that show such dependencies? I'll see if I can tweak the sed rules in makedepend.SH to ignore them.

FWIW I can't reproduce that with "gcc (GCC) 4.1.2 20061110 (prerelease) (4.1.2-0.20061110.1mdv2007.1)". (mumbles)

p5pRT commented 17 years ago

From @smpeters

On Sat Dec 09 05​:25​:25 2006\, perlbug@​plan9.de wrote​:

This is a bug report for perl from perlbug@​plan9.de\, generated with the help of perlbug 1.35 running under perl v5.8.8.

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

Since using gcc-4\, "make" in the perl diretcory re-builds perl again everytime.

The reason is that the build directory gets listed as one of the dependencies for every file\, and that directory changes on each compile\, so everythine is remade again and again.

The indirect reason is thta makedepend gets that directory form cpp output\, which starts like this​:

# 1 "\" # 1 "/root/cvt/perl/perl-5.8.x//"

Why gcc-4 (as opposed to gcc-3) includes this\, I have no idea\, but I would suggest ignoring any directories when automatically extratcing dependencies for that reason.

It isn't just gcc-4+. From a make on one of my systems...

Making Errno (nonxs)

  Making IO​::Compress​::Base (nonxs)

  Making IO​::Compress​::Zlib (nonxs) rm -f libperl.a /usr/bin/ar rcu libperl.a gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o hv.o av.o perl. o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xs utils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o
DynaLoader.o cc -o perl -pthread -Wl\,-E -L/usr/local/lib perlmain.o libperl.a `cat ext.libs` -lm -lcrypt ./miniperl -Ilib mkppport ppport.h in ext/Compress/Raw/Zlib is up-to-date ppport.h in ext/Cwd is up-to-date ppport.h in ext/Data/Dumper is up-to-date ppport.h in ext/Digest/SHA is up-to-date ppport.h in ext/Sys/Syslog is up-to-date ppport.h in ext/Time/HiRes is up-to-date ppport.h in win32/ext/Win32API/File is up-to-date

gcc -v Using built-in specs. Configured with​: FreeBSD/i386 system compiler Thread model​: posix gcc version 3.4.4 [FreeBSD] 20050518

p5pRT commented 17 years ago

From @smpeters

On Tue Dec 19 17​:35​:17 2006\, stmpeters wrote​:

On Sat Dec 09 05​:25​:25 2006\, perlbug@​plan9.de wrote​:

This is a bug report for perl from perlbug@​plan9.de\, generated with the help of perlbug 1.35 running under perl v5.8.8.

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

Since using gcc-4\, "make" in the perl diretcory re-builds perl again everytime.

The reason is that the build directory gets listed as one of the dependencies for every file\, and that directory changes on each compile\, so everythine is remade again and again.

The indirect reason is thta makedepend gets that directory form cpp output\, which starts like this​:

# 1 "\" # 1 "/root/cvt/perl/perl-5.8.x//"

Why gcc-4 (as opposed to gcc-3) includes this\, I have no idea\, but I would suggest ignoring any directories when automatically extratcing dependencies for that reason.

It isn't just gcc-4+. From a make on one of my systems...

Making Errno (nonxs)

    Making IO&#8203;::Compress&#8203;::Base \(nonxs\)

    Making IO&#8203;::Compress&#8203;::Zlib \(nonxs\)

rm -f libperl.a /usr/bin/ar rcu libperl.a gv.o toke.o perly.o op.o pad.o regcomp.o dump.o util.o mg.o reentr.o hv.o av.o perl. o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xs utils.o globals.o perlio.o perlapi.o numeric.o mathoms.o locale.o pp_pack.o pp_sort.o DynaLoader.o cc -o perl -pthread -Wl\,-E -L/usr/local/lib perlmain.o libperl.a `cat ext.libs` -lm -lcrypt ./miniperl -Ilib mkppport ppport.h in ext/Compress/Raw/Zlib is up-to-date ppport.h in ext/Cwd is up-to-date ppport.h in ext/Data/Dumper is up-to-date ppport.h in ext/Digest/SHA is up-to-date ppport.h in ext/Sys/Syslog is up-to-date ppport.h in ext/Time/HiRes is up-to-date ppport.h in win32/ext/Win32API/File is up-to-date

gcc -v Using built-in specs. Configured with​: FreeBSD/i386 system compiler Thread model​: posix gcc version 3.4.4 [FreeBSD] 20050518

The cause seems to be in this change.

Change 27549 by gisle@​gisle-ask on 2006/03/20 10​:21​:50

  Move DynaLoader.o into libperl.so.  
  This avoids the need to statically link DynaLoader into the stub perl   executable and make libperl.so provide all the code needed to get a   functional embedded perl interpreter up running. As a side effect   this also moves DynaLoader into libperl.a for non-useshrplib builds.  
  Fixes [perl #32539]

It seems to start out the various builds making DynaLoader. This change added the following to DynaLoader's Makefile.PL.

==== //depot/perl/ext/DynaLoader/Makefile.PL#14 (text) ====

@​@​ -32\,3 +32\,10 @​@​ '; }

+sub MY​::static { + ' +static :​: $(FIRST_MAKEFILE) $(OBJECT) + $(RM_RF) $(PERL_SRC)/$(OBJECT) + $(CP) $(OBJECT) $(PERL_SRC)/$(OBJECT) +'; +}

which does the following every make

Making DynaLoader (static) rm -rf ../../DynaLoader.o cp DynaLoader.o ../../DynaLoader.o

which forces the Perl rebuild.

p5pRT commented 17 years ago

From schmorp@schmorp.de

On Tue\, Dec 19\, 2006 at 05​:52​:06PM -0800\, Steve Peters via RT \perlbug\-followup@&#8203;perl\.org wrote​:

The cause seems to be in this change.

Change 27549 by gisle@​gisle-ask on 2006/03/20 10​:21​:50

Move DynaLoader\.o into libperl\.so\.

==== //depot/perl/ext/DynaLoader/Makefile.PL#14 (text) ====

@​@​ -32\,3 +32\,10 @​@​ '; }

+sub MY​::static { + ' +static :​: $(FIRST_MAKEFILE) $(OBJECT) + $(RM_RF) $(PERL_SRC)/$(OBJECT) + $(CP) $(OBJECT) $(PERL_SRC)/$(OBJECT) +'; +}

which does the following every make

Making DynaLoader (static) rm -rf ../../DynaLoader.o cp DynaLoader.o ../../DynaLoader.o

which forces the Perl rebuild.

Just FYI​: this might be an additional problem causing rebuilds\, but it is not the same one as I reported\, which is caused purely by depending on the perl build directory.

--   The choice of a   -----==- _GNU_   ----==-- _ generation Marc Lehmann   ---==---(_)__ __ ____ __ pcg@​goof.com   --==---/ / _ \/ // /\ \/ / http​://schmorp.de/   -=====/_/_//_/\_\,_/ /_/\_\ XX11-RIPE

p5pRT commented 17 years ago

From @mhx

On 2006-12-12\, at 18​:24​:27 +0100\, Rafael Garcia-Suarez wrote​:

On 12/12/06\, Andy Dougherty \doughera@&#8203;lafayette\.edu wrote​:

I'm afraid I can't reproduce this. I used stock perl-5.8.8 and gcc-4.1.1.

The only relevant thing I see is that your gcc is

gccversion='4\.1\.2 20061115 \(prerelease\) \(Debian 4\.1\.1\-20\)'

while mine is simply

gccversion='4\.1\.1'

I guess that the 4.1.2 release will be adding this "feature". Could you send me a few sample lines from your 'makefile' that show such dependencies? I'll see if I can tweak the sed rules in makedepend.SH to ignore them.

FWIW I can't reproduce that with "gcc (GCC) 4.1.2 20061110 (prerelease) (4.1.2-0.20061110.1mdv2007.1)". (mumbles)

It seems to be caused by gcc's -g flag​:

  mhx@​r2d2 ~ $ echo | gcc-4.3 -E -   # 1 "\"   # 1 "\<built-in>"   # 1 "\<command-line>"   # 1 "\"

  mhx@​r2d2 ~ $ echo | gcc-4.3 -E -g -   # 1 "\"   # 1 "/home/mhx//"   # 1 "\<built-in>"   # 1 "\<command-line>"   # 1 "\"

And it also happens with recent gcc-3 releases​:

  mhx@​r2d2 ~ $ echo | gcc-3.3.6 -E -g -   # 1 "\"   # 1 "\<built-in>"   # 1 "\"   # 1 "\"

  mhx@​r2d2 ~ $ echo | gcc-3.4.6 -E -g -   # 1 "\"   # 1 "/home/mhx//"   # 1 "\<built-in>"   # 1 "\"   # 1 "\"

This fixes the problem for me​:

Inline Patch ```diff --- perl-current-orig/makedepend.SH 2006-07-25 20:45:11.000000000 +0200 +++ perl-current/makedepend.SH 2007-01-18 14:16:19.000000000 +0100 @@ -169,6 +169,7 @@ -e '/^#.*/d' \ -e '/^#.*/d' \ -e '/^#.*"-"/d' \ + -e '/^#.*"\/.*\/"/d' \ -e '/: file path prefix .* never used$/d' \ -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ -e 's/^[ ]*#[ ]*line/#/' \ ```

Marcus

-- Man is the best computer we can put aboard a spacecraft ... and the only one that can be mass produced with unskilled labor.   -- Wernher von Braun

p5pRT commented 17 years ago

From @tux

On Thu\, 18 Jan 2007 14​:27​:55 +0100\, Marcus Holland-Moritz \mhx\-perl@&#8203;gmx\.net wrote​:

On 2006-12-12\, at 18​:24​:27 +0100\, Rafael Garcia-Suarez wrote​:

On 12/12/06\, Andy Dougherty \doughera@&#8203;lafayette\.edu wrote​:

I'm afraid I can't reproduce this. I used stock perl-5.8.8 and gcc-4.1.1.

The only relevant thing I see is that your gcc is

gccversion='4\.1\.2 20061115 \(prerelease\) \(Debian 4\.1\.1\-20\)'

while mine is simply

gccversion='4\.1\.1'

I guess that the 4.1.2 release will be adding this "feature". Could you send me a few sample lines from your 'makefile' that show such dependencies? I'll see if I can tweak the sed rules in makedepend.SH to ignore them.

FWIW I can't reproduce that with "gcc (GCC) 4.1.2 20061110 (prerelease) (4.1.2-0.20061110.1mdv2007.1)". (mumbles)

It seems to be caused by gcc's -g flag​:

mhx@​r2d2 ~ $ echo | gcc-4.3 -E - # 1 "\" # 1 "\<built-in>" # 1 "\<command-line>" # 1 "\"

mhx@​r2d2 ~ $ echo | gcc-4.3 -E -g - # 1 "\" # 1 "/home/mhx//" # 1 "\<built-in>" # 1 "\<command-line>" # 1 "\"

And it also happens with recent gcc-3 releases​:

mhx@​r2d2 ~ $ echo | gcc-3.3.6 -E -g - # 1 "\" # 1 "\<built-in>" # 1 "\" # 1 "\"

mhx@​r2d2 ~ $ echo | gcc-3.4.6 -E -g - # 1 "\" # 1 "/home/mhx//" # 1 "\<built-in>" # 1 "\" # 1 "\"

This fixes the problem for me​:

--- perl-current-orig/makedepend.SH 2006-07-25 20​:45​:11.000000000 +0200 +++ perl-current/makedepend.SH 2007-01-18 14​:16​:19.000000000 +0100 @​@​ -169\,6 +169\,7 @​@​ -e '/^#.*\/d' \ -e '/^#.*\<command-line>/d' \ -e '/^#.*"-"/d' \ + -e '/^#.*"\/.*\/"/d' \ -e '/​: file path prefix .* never used$/d' \ -e 's#\.[0-9][0-9]*\.c#'"$file.c#" \ -e 's/^[ ]*#[ ]*line/#/' \

What a nice analysis. I have applied this in change #29871

-- H.Merijn Brand Amsterdam Perl Mongers (http​://amsterdam.pm.org/) using & porting perl 5.6.2\, 5.8.x\, 5.9.x on HP-UX 10.20\, 11.00\, 11.11\, & 11.23\, SuSE 10.0 & 10.1\, AIX 4.3 & 5.2\, and Cygwin. http​://qa.perl.org http​://mirrors.develooper.com/hpux/ http​://www.test-smoke.org   http​://www.goldmark.org/jeff/stupid-disclaimers/

p5pRT commented 16 years ago

p5p@spam.wizbit.be - Status changed from 'open' to 'resolved'