Skip to content

'make clean' defect #14109

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

Closed
p5pRT opened this issue Sep 22, 2014 · 10 comments
Closed

'make clean' defect #14109

p5pRT opened this issue Sep 22, 2014 · 10 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 22, 2014

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

Searchable as RT122823$

@p5pRT
Copy link
Author

p5pRT commented Sep 22, 2014

From @jkeenan

In the course of solving a problem with 'make distclean', Craig Berry noted (https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122820#txn-1309944):

#####
"make clean" is even more seriously broken -- it removes "Config_git.pl" which it then depends on for nearly everything it does. But that's a different bug, and was the same before and after [the fix applied for 'make distclean' in 9fa5aa9].
#####

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Sep 22, 2014

From @jkeenan

Summary of my perl5 (revision 5 version 21 subversion 5) configuration​:
  Commit id​: e96513a
  Platform​:
  osname=linux, osvers=3.13.0-35-generic, archname=x86_64-linux
  uname='linux zareason 3.13.0-35-generic #62-ubuntu smp fri aug 15 01​:58​:42 utc 2014 x86_64 x86_64 x86_64 gnulinux '
  config_args='-des -Dusedevel -DDEBUGGING'
  hint=recommended, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2 -g',
  cppflags='-fwrapv -DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
  ccversion='', gccversion='4.8.2', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16, longdblkind=3
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib
  libs=-lnsl -ldl -lm -lcrypt -lutil -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
  libc=libc-2.19.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.19'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -O2 -g -L/usr/local/lib -fstack-protector'

Characteristics of this binary (from libperl)​:
  Compile-time options​: DEBUGGING HAS_TIMES PERLIO_LAYERS
  PERL_DONT_CREATE_GVSV
  PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_MALLOC_WRAP
  PERL_NEW_COPY_ON_WRITE PERL_PRESERVE_IVUV
  PERL_USE_DEVEL USE_64_BIT_ALL USE_64_BIT_INT
  USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE
  USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_LOCALE_TIME
  USE_PERLIO USE_PERL_ATOF
  Built under linux
  Compiled at Sep 21 2014 09​:47​:45
  %ENV​:
  PERL5LIB="/home/jkeenan/perl5/lib/perl5"
  PERLBREW_BASHRC_VERSION="0.67"
  PERLBREW_HOME="/home/jkeenan/.perlbrew"
  PERLBREW_MANPATH="/home/jkeenan/perl5/perlbrew/perls/perl-5.20.0/man"
  PERLBREW_PATH="/home/jkeenan/perl5/perlbrew/bin​:/home/jkeenan/perl5/perlbrew/perls/perl-5.20.0/bin"
  PERLBREW_PERL="perl-5.20.0"
  PERLBREW_ROOT="/home/jkeenan/perl5/perlbrew"
  PERLBREW_VERSION="0.67"
  PERL_LOCAL_LIB_ROOT="/home/jkeenan/perl5"
  PERL_MB_OPT="--install_base "/home/jkeenan/perl5""
  PERL_MM_OPT="INSTALL_BASE=/home/jkeenan/perl5"
  PERL_WORKDIR="gitwork/perl"
  @​INC​:
  lib
  /home/jkeenan/perl5/lib/perl5/x86_64-linux
  /home/jkeenan/perl5/lib/perl5
  /usr/local/lib/perl5/site_perl/5.21.5/x86_64-linux
  /usr/local/lib/perl5/site_perl/5.21.5
  /usr/local/lib/perl5/5.21.5/x86_64-linux
  /usr/local/lib/perl5/5.21.5
  .

@p5pRT
Copy link
Author

p5pRT commented Sep 22, 2014

From @craigberry

On Sun, Sep 21, 2014 at 8​:58 PM, James E Keenan
<perlbug-followup@​perl.org> wrote​:

# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122823 >

In the course of solving a problem with 'make distclean', Craig Berry noted (https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122820#txn-1309944):

#####
"make clean" is even more seriously broken -- it removes "Config_git.pl" which it then depends on for nearly everything it does. But that's a different bug, and was the same before and after [the fix applied for 'make distclean' in 9fa5aa9].
#####

Note that the warning I see during "make clean" many many times,
"Warning​: failed to load Config_git.pl, something strange about this
perl...", may be just a red herring and I might've jumped to
conclusions about its import for the clean target not working. The
real problem is that while "make distclean" by itself now works, "make
clean" followed by "make distclean" doesn't, i.e., it leaves a lot of
build products lying around that it shouldn't.

@p5pRT
Copy link
Author

p5pRT commented Sep 22, 2014

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

@p5pRT
Copy link
Author

p5pRT commented Sep 22, 2014

From @doughera88

On Sun, Sep 21, 2014 at 10​:26​:14PM -0500, "Craig A. Berry" wrote​:

On Sun, Sep 21, 2014 at 8​:58 PM, James E Keenan
<perlbug-followup@​perl.org> wrote​:

# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122823 >

In the course of solving a problem with 'make distclean', Craig Berry noted (https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122820#txn-1309944):

#####
"make clean" is even more seriously broken -- it removes "Config_git.pl" which it then depends on for nearly everything it does. But that's a different bug, and was the same before and after [the fix applied for 'make distclean' in 9fa5aa9].
#####

Note that the warning I see during "make clean" many many times,
"Warning​: failed to load Config_git.pl, something strange about this
perl...", may be just a red herring and I might've jumped to
conclusions about its import for the clean target not working. The
real problem is that while "make distclean" by itself now works, "make
clean" followed by "make distclean" doesn't, i.e., it leaves a lot of
build products lying around that it shouldn't.

I don't think "make clean" has ever done anything very useful. It's certainly
never been documented as useful. Currently, INSTALL says​:

  (A plain 'make clean' will not delete the makefiles used for
  rebuilding perl, and will also not delete a number of library and
  utility files extracted during the build process.)

Because of the way the perl build bootstraps, I don't know what reasonable
expectations for "make clean" would even be. It may be that clean ==
realclean is the only thing that could actually be made to work.

--
  Andy Dougherty doughera@​lafayette.edu

@p5pRT
Copy link
Author

p5pRT commented Sep 22, 2014

From @craigberry

On Mon, Sep 22, 2014 at 6​:38 AM, Andy Dougherty <doughera@​lafayette.edu> wrote​:

On Sun, Sep 21, 2014 at 10​:26​:14PM -0500, "Craig A. Berry" wrote​:

On Sun, Sep 21, 2014 at 8​:58 PM, James E Keenan
<perlbug-followup@​perl.org> wrote​:

# <URL​: https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122823 >

In the course of solving a problem with 'make distclean', Craig Berry noted (https://rt-archive.perl.org/perl5/Ticket/Display.html?id=122820#txn-1309944):

#####
"make clean" is even more seriously broken -- it removes "Config_git.pl" which it then depends on for nearly everything it does. But that's a different bug, and was the same before and after [the fix applied for 'make distclean' in 9fa5aa9].
#####

Note that the warning I see during "make clean" many many times,
"Warning​: failed to load Config_git.pl, something strange about this
perl...", may be just a red herring and I might've jumped to
conclusions about its import for the clean target not working. The
real problem is that while "make distclean" by itself now works, "make
clean" followed by "make distclean" doesn't, i.e., it leaves a lot of
build products lying around that it shouldn't.

I don't think "make clean" has ever done anything very useful. It's certainly
never been documented as useful. Currently, INSTALL says​:

\(A plain 'make clean' will not delete the makefiles used for
rebuilding perl\, and will also not delete a number of library and
utility files extracted during the build process\.\)

Because of the way the perl build bootstraps, I don't know what reasonable
expectations for "make clean" would even be. It may be that clean ==
realclean is the only thing that could actually be made to work.

Yeah, I'm starting to see that clean doesn't play nice with the other
clean-up targets. The fundamental problem is that make clean (via the
intermediate _mopup target in Makefile.SH) deletes miniperl. Then
make distclean (via _cleaner1) would use miniperl to clean up
extensions if miniperl exists, but it now doesn't. There is some
Unix-only fallback code in shell scripts (realclean.sh and
veryclean.sh) that seems not to be working quite right at least when
invoked via distclean.

I would be fine with saying clean --> distclean is not a supported
combination and closing the ticket. I have not tried clean -->
realclean.

@p5pRT
Copy link
Author

p5pRT commented Oct 6, 2014

From @tonycoz

On Mon Sep 22 04​:39​:14 2014, doughera wrote​:

I don't think "make clean" has ever done anything very useful. It's
certainly
never been documented as useful. Currently, INSTALL says​:

(A plain 'make clean' will not delete the makefiles used for
rebuilding perl, and will also not delete a number of library and
utility files extracted during the build process.)

Because of the way the perl build bootstraps, I don't know what
reasonable
expectations for "make clean" would even be. It may be that clean ==
realclean is the only thing that could actually be made to work.

make clean has been documented as not useful since 1997.

The attached patch makes make clean behave the same as make distclean.

Tony

@p5pRT
Copy link
Author

p5pRT commented Oct 6, 2014

From @tonycoz

0001-change-make-clean-to-be-equivalent-to-make-realclean.patch
From e8d68e40e8b4a7d9b2274b44d6c561453b3c208f Mon Sep 17 00:00:00 2001
From: Tony Cook <[email protected]>
Date: Tue, 7 Oct 2014 10:33:58 +1100
Subject: change 'make clean' to be equivalent to 'make realclean'

'make clean' hasn't been useful since at least 1997, change it to
something that is useful, 'make realclean'
---
 INSTALL             |    5 ++---
 Makefile.SH         |   11 +----------
 Porting/pumpkin.pod |    6 ------
 3 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/INSTALL b/INSTALL
index bef2786..196ae6a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2363,9 +2363,8 @@ or
 	make realclean
 
 The only difference between the two is that make distclean also removes
-your old config.sh and Policy.sh files.  (A plain 'make clean' will not
-delete the makefiles used for rebuilding perl, and will also not delete
-a number of library and utility files extracted during the build process.)
+your old config.sh and Policy.sh files.  (A plain 'make clean' is now
+eqivalent to 'make realclean'.)
 
 If you are upgrading from a previous version of perl, or if you
 change systems or compilers or make other significant changes, or if
diff --git a/Makefile.SH b/Makefile.SH
index 7b1fd5b..7878077 100755
--- a/Makefile.SH
+++ b/Makefile.SH
@@ -1216,7 +1216,7 @@ printconfig:
 	realclean _realcleaner clobber _clobber \
 	distclean veryclean _verycleaner
 
-clean:		_tidy _mopup 
+clean:		realclean
 
 realclean:	_realcleaner _mopup
 	@echo "Note that '$(MAKE) realclean' does not delete config.sh or Policy.sh"
@@ -1248,15 +1248,6 @@ _mopup:
 	-rm -f $(PERL_EXE) $(MINIPERL_EXE) $(LIBPERL) libperl.* microperl
 	-rm -f config.arch config.over $(DTRACE_H)
 
-# Do not 'make _tidy' directly.
-_tidy:
-	-cd pod; $(LDLIBPTH) $(MAKE) clean
-	-cd utils; $(LDLIBPTH) $(MAKE) clean
-	-rm -f lib/Config_git.pl git_version.h
-	-@for x in $(DYNALOADER) $(dynamic_ext) $(static_ext) $(nonxs_ext) ; do \
-	$(MINIPERL) make_ext.pl --target=clean $$x MAKE="$(MAKE)" ; \
-	done
-
 _cleaner1:
 	-cd os2; rm -f Makefile
 	-cd pod; $(LDLIBPTH) $(MAKE) $(CLEAN)
diff --git a/Porting/pumpkin.pod b/Porting/pumpkin.pod
index a8c8fb0..0a6165f 100644
--- a/Porting/pumpkin.pod
+++ b/Porting/pumpkin.pod
@@ -1265,12 +1265,6 @@ I've received sensible suggestions for --exec_prefix and other
 GNU configure --options.  It's not always obvious exactly what is
 intended, but this merits investigation.
 
-=item make clean
-
-Currently, B<make clean> isn't all that useful, though
-B<make realclean> and B<make distclean> are.  This needs a bit of
-thought and documentation before it gets cleaned up.
-
 =item Try gcc if cc fails
 
 Currently, we just give up.
-- 
1.7.10.4

@p5pRT
Copy link
Author

p5pRT commented Nov 5, 2014

From @tonycoz

On Mon Oct 06 16​:38​:02 2014, tonyc wrote​:

On Mon Sep 22 04​:39​:14 2014, doughera wrote​:

I don't think "make clean" has ever done anything very useful. It's
certainly
never been documented as useful. Currently, INSTALL says​:

(A plain 'make clean' will not delete the makefiles used for
rebuilding perl, and will also not delete a number of library and
utility files extracted during the build process.)

Because of the way the perl build bootstraps, I don't know what
reasonable
expectations for "make clean" would even be. It may be that clean ==
realclean is the only thing that could actually be made to work.

make clean has been documented as not useful since 1997.

The attached patch makes make clean behave the same as make distclean.

No comments, so no-one objects ;)

Applied as dd8235d.

Tony

@p5pRT
Copy link
Author

p5pRT commented Nov 5, 2014

@tonycoz - Status changed from 'open' to 'resolved'

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

1 participant