This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: make clean fails to delete .a and .so.X.Y files
Type: behavior Stage: needs patch
Components: Build Versions: Python 3.1, Python 2.7, Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: ajaksu2, eric.araujo, georg.brandl, l0nwlf, loewis, vstinner
Priority: normal Keywords: easy, patch

Created on 2008-10-01 12:52 by skip.montanaro, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (9)
msg74128 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2008-10-01 12:52
The "clean" target in the makefile fails to delete the libpython.a file
and the libpython.so.X.Y file (should you have configured using
--enable-shared).  The attached trivial patch solves that problem.
The patch is against the trunk as of just before the 2.6 final release.
It will almost certainly apply cleanly to the py3k version as well.
msg102677 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2010-04-09 04:19
Skip, was there a patch here? I can't find it in the bug lists, so I think we both missed it?

Pinging Martin in case the tracker ate the patch :)
msg102679 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2010-04-09 05:46
If it did eat the patch, we would have lost it by now: there is nothing in the history that shows that a file was attached at some point. More likely, Skip forgot to attach it when submitting this report.
msg102686 - (view) Author: Shashwat Anand (l0nwlf) Date: 2010-04-09 06:46
skip.montanaro forgot to attached the patch obviously, however the issue is trivial but there i.e. the presence of libpython.a file.
msg102711 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2010-04-09 12:17
Martin> If it did eat the patch, we would have lost it by now: there is
    Martin> nothing in the history that shows that a file was attached at
    Martin> some point. More likely, Skip forgot to attach it when
    Martin> submitting this report.

Yeah, I must have just forgotten to attach it.  At one point I'm pretty sure
I had something in my sandbox, but have nothing now.  Removing .a files is
pretty straightforward.  Removing .so.X.Y files is a little more cumbersome
because globbing isn't perfect.  This (only lightly tested) patch should be
good enough though:

Index: Makefile.pre.in
===================================================================
--- Makefile.pre.in     (revision 79207)
+++ Makefile.pre.in     (working copy)
@@ -1156,8 +1156,9 @@
        find $(srcdir) -name '*.py[co]' -exec rm -f {} ';'

 clean: pycremoval
-       find . -name '*.o' -exec rm -f {} ';'
+       find . -name '*.[oa]' -exec rm -f {} ';'
        find . -name '*.s[ol]' -exec rm -f {} ';'
+       find . -name '*.so.[0-9]*.[0-9]*' -exec rm -f {} ';'
        find build -name 'fficonfig.h' -exec rm -f {} ';' || true
        find build -name 'fficonfig.py' -exec rm -f {} ';' || true
        -rm -f Lib/lib2to3/*Grammar*.pickle

even though the second addition would also match files like

    Margaret.so.9a.1g4

Skip
msg105839 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-05-15 23:53
Note: Using find -delete avoids the extra process spawning for rm. However, if the -f option is really necessary, we’ll have to use rm.

Someone has an idea about the imperfect regex/glob pattern?
msg105841 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2010-05-16 00:14
>> Note: Using find -delete avoids the extra process spawning for rm.

The -delete expression isn't universally available.  For example, it is not
present on Solaris.  Better just to stick with the reliable rm.

Skip
msg106228 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2010-05-21 11:11
Yes, "make clean" should remove *.a and *.so.* files. The patch looks ok.
msg112216 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-07-31 22:05
Applied in r83372.
History
Date User Action Args
2022-04-11 14:56:39adminsetgithub: 48257
2010-07-31 22:05:59georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg112216

resolution: accepted
2010-05-21 11:11:16vstinnersetnosy: + vstinner
messages: + msg106228
2010-05-20 20:41:14skip.montanarosetnosy: - skip.montanaro
2010-05-16 00:14:05skip.montanarosetmessages: + msg105841
2010-05-15 23:53:38eric.araujosetnosy: + eric.araujo
messages: + msg105839
2010-04-09 12:17:53skip.montanarosetmessages: + msg102711
2010-04-09 06:46:44l0nwlfsetnosy: + l0nwlf
messages: + msg102686
2010-04-09 05:46:11loewissetmessages: + msg102679
2010-04-09 04:19:22ajaksu2setversions: + Python 3.1, Python 2.7
nosy: + ajaksu2, loewis

messages: + msg102677

stage: needs patch
2009-05-17 02:42:55ajaksu2setversions: + Python 2.6
2008-10-01 12:52:37skip.montanarocreate