Skip to contentSkip to conversation

tools/python: Clean python correctly

PATCH Andrew Cooper 3 participants 6 messages Aug 14, 2012 – Aug 17, 2012

lore
Share & tools
lore
#0 lore raw

I discovered this with repeated calls to "make clean; make dist-tools"

An alternative, if you wish to remove the use of $(PYTHON) from the clean path is to just rm -rf build, but using setup.py seems neater.

Signature · 2 lines
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

# HG changeset patch
# Parent 33d596f46521ea852e90cf6dbdbf3680d104134c
tools/python: Clean python correctly

Cleaning the python directory should call $(PYTHON) setup.py clean which will clean the build/ subdirectory. Otherwise, subsequent builds may be short-circuited and a stale build installed.

tools/python/Makefile +1 -0
diff -r 33d596f46521 tools/python/Makefile
@@ -33,6 +33,7 @@ test:
 
 .PHONY: clean
 clean:
+	$(PYTHON) setup.py clean
 	rm -f $(XENPATH)
 	rm -rf *.pyc *.pyo *.o *.a *~ xen/util/auxbin.pyc
 	rm -f xen/lowlevel/xl/_pyxl_types.h

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw

Re: (V2) tools/python: Clean python correctly

Attached version 2, because it seems that despite my testing, "python setup.py clean" still doesn't actually clean enough.

Quoted 5 lines · Andrew Cooper

I discovered this with repeated calls to "make clean; make dist-tools"

An alternative, if you wish to remove the use of $(PYTHON) from the clean path is to just rm -rf build, but using setup.py seems neater.

Signature · 2 lines
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

# HG changeset patch
# Parent 33d596f46521ea852e90cf6dbdbf3680d104134c
tools/python: Clean python correctly

Cleaning the python directory should call $(PYTHON) setup.py clean which will clean the build/ subdirectory. Otherwise, subsequent builds may be short-circuited and a stale build installed.

tools/python/Makefile +1 -0
diff -r 33d596f46521 tools/python/Makefile
@@ -33,6 +33,7 @@ test:
 
 .PHONY: clean
 clean:
+	$(PYTHON) setup.py clean --all
 	rm -f $(XENPATH)
 	rm -rf *.pyc *.pyo *.o *.a *~ xen/util/auxbin.pyc
 	rm -f xen/lowlevel/xl/_pyxl_types.h

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#2 lore raw

Re: (V2) tools/python: Clean python correctly

Andrew Cooper writes ("Re: [Xen-devel] (V2) tools/python: Clean python correctly"):

Quoted 8 lines

Attached version 2, because it seems that despite my testing, "python setup.py clean" still doesn't actually clean enough.

Quoted 4 lines · Andrew Cooper

I discovered this with repeated calls to "make clean; make dist-tools"

An alternative, if you wish to remove the use of $(PYTHON) from the clean path is to just rm -rf build, but using setup.py seems neater.

Perhaps removing the build directory would be better and faster and more reliable ?

Ian.

#3 lore raw

Re: (V2) tools/python: Clean python correctly

Quoted 5 lines · Ian Jackson

Andrew Cooper writes ("Re: [Xen-devel] (V2) tools/python: Clean python correctly"):

Quoted 4 lines

Attached version 2, because it seems that despite my testing, "python setup.py clean" still doesn't actually clean enough.

On 14/08/12 15:10, Andrew Cooper wrote:

Quoted 8 lines
Quoted 4 lines
Quoted 4 lines

I discovered this with repeated calls to "make clean; make dist-tools"

An alternative, if you wish to remove the use of $(PYTHON) from the clean path is to just rm -rf build, but using setup.py seems neater.

Perhaps removing the build directory would be better and faster and more reliable ?

Ian.

That would put the code in line with tools/pygrub. Sec while I make a v3 patch

Signature · 2 lines
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com
#4 lore raw

Re: (V3) tools/python: Clean python correctly

Quoted 10 lines · Andrew Cooper
Quoted 10 lines
Quoted 4 lines
Quoted 4 lines

I discovered this with repeated calls to "make clean; make dist-tools"

An alternative, if you wish to remove the use of $(PYTHON) from the clean path is to just rm -rf build, but using setup.py seems neater.

Perhaps removing the build directory would be better and faster and more reliable ?

Ian.

Attached

Signature · 2 lines
Andrew Cooper - Dom0 Kernel Engineer, Citrix XenServer
T: +44 (0)1223 225 900, http://www.citrix.com

# HG changeset patch
# Parent 33d596f46521ea852e90cf6dbdbf3680d104134c
tools/python: Clean python correctly

Cleaning the python directory should completely remove the build/ directory, otherwise subsequent builds may be short-circuited and a stale build installed.

tools/python/Makefile +1 -1
diff -r 33d596f46521 tools/python/Makefile
@@ -34,7 +34,7 @@ test:
 .PHONY: clean
 clean:
 	rm -f $(XENPATH)
-	rm -rf *.pyc *.pyo *.o *.a *~ xen/util/auxbin.pyc
+	rm -rf build/ *.pyc *.pyo *.o *.a *~ xen/util/auxbin.pyc
 	rm -f xen/lowlevel/xl/_pyxl_types.h
 	rm -f xen/lowlevel/xl/_pyxl_types.c
 	rm -f $(DEPS)

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

Acked-by
#5 lore raw

Re: (V3) tools/python: Clean python correctly

Quoted 7 lines · Andrew Cooper

tools/python: Clean python correctly

Cleaning the python directory should completely remove the build/ directory, otherwise subsequent builds may be short-circuited and a stale build installed.

And applied, thanks,
Ian.