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: Tools/freeze/winmakemakefile.py clean target should use 'del' instead of 'rm'
Type: behavior Stage: resolved
Components: Demos and Tools, Windows Versions: Python 3.6, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: David D, lisroach, paul.moore, python-dev, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: easy, patch

Created on 2016-07-18 19:50 by David D, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
rm_to_del.patch lisroach, 2016-08-04 02:14 review
Messages (6)
msg270787 - (view) Author: David D (David D) Date: 2016-07-18 19:50
The command for the clean target in the Windows makefile is the same as the one in the Linux one: using `rm -f`.

Should be changed to `del /f` or `erase /f`.
msg271938 - (view) Author: Lisa Roach (lisroach) * (Python committer) Date: 2016-08-04 02:14
I think this patch makes the proper fix, changed the lines:

    print("\t-rm -f *.obj")
    print("\t-rm -f $(target).exe")

to 

    print("\t-del /f *.obj")
    print("\t-del /f $(target).exe")
msg271988 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-08-04 16:00
I suspect it will also need the /Q option, at least on the one with the wildcard, otherwise there will be a prompt. Though I'm not entirely clear on where this is run (nmake?) so maybe it's already suppressed.

The fact that I'm not familiar with this makefile suggests it isn't needed for normal Windows builds though, and if this is only meant for Cygwin/MinGW builds then I think assuming rf availability is fine.
msg271992 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2016-08-04 16:53
It is run by nmake.

This isn't Cygwin-related, it's for 'freezing' a program a la py2exe or cx_Freeze; see Tools/freeze/README.  I have yet to try it without py2exe or cx_Freeze, but it's theoretically possible :)
msg275533 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-10 01:42
New changeset e96eb2bd0d5e by Steve Dower in branch '2.7':
Issue #27566: Fix clean target in freeze makefile (patch by Lisa Roach)
https://hg.python.org/cpython/rev/e96eb2bd0d5e

New changeset 3ffff303df95 by Steve Dower in branch '3.5':
Issue #27566: Fix clean target in freeze makefile (patch by Lisa Roach)
https://hg.python.org/cpython/rev/3ffff303df95

New changeset 6a2d95630a7c by Steve Dower in branch 'default':
Issue #27566: Fix clean target in freeze makefile (patch by Lisa Roach)
https://hg.python.org/cpython/rev/6a2d95630a7c
msg275534 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-10 01:42
Committed the patch as-is. I suspect make will have a way to suppress UI anyway, but if not then we can do another patch!
History
Date User Action Args
2022-04-11 14:58:33adminsetgithub: 71753
2016-09-10 01:42:47steve.dowersetstatus: open -> closed
resolution: fixed
messages: + msg275534

stage: patch review -> resolved
2016-09-10 01:42:10python-devsetnosy: + python-dev
messages: + msg275533
2016-08-04 16:53:01zach.waresetmessages: + msg271992
2016-08-04 16:00:19steve.dowersetmessages: + msg271988
2016-08-04 06:39:35SilentGhostsetstage: needs patch -> patch review
2016-08-04 02:14:24lisroachsetfiles: + rm_to_del.patch

nosy: + lisroach
messages: + msg271938

keywords: + patch
2016-07-18 19:53:43zach.waresetkeywords: + easy
title: Freeze: winmakemakefile.py: clean: Linux instead of Windows command -> Tools/freeze/winmakemakefile.py clean target should use 'del' instead of 'rm'
stage: needs patch
versions: - Python 3.2, Python 3.3, Python 3.4
2016-07-18 19:50:39David Dcreate