Skip to contentSkip to conversation

build: remove .d files from xen/ on a clean

PATCH In review Jonathan Creekmore 3 participants 10 messages Nov 24, 2015 – Nov 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: remove .d files from xen/ on a clean

Dependency files were getting left behind in the xen directory (since 8b6ef9c152edceabecc7f90c811cd538a7b7a110), so append the $(DEPS) to the clean rule that runs in the hypervisor directory.

CC Ian Campbell <[email protected]>
CC Ian Jackson <[email protected]>
CC Jan Beulich <[email protected]>
CC Keir Fraser <[email protected]>
CC Tim Deegan <[email protected]>
---
 xen/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
xen/Makefile +1 -1
index c556198..fa9cf0a 100644
@@ -88,7 +88,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core $(DEPS)
 	rm -f include/asm-*/asm-offsets.h
 	rm -f .banner
 
Signature · 1 line
2.4.9 (Apple Git-60)
#1 lore raw

xen/Makefile _clean: delete-unfresh-files · line 91

Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 24.11.15 at 17:56, <[email protected]> wrote:
xen/Makefile +1 -1
@@ -88,7 +88,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core $(DEPS)

Is this really a problem only in xen/ ? The referenced commit clearly introduces "stray" *.d files elsewhere. Also there aren't any source files in xen/, so I'd expect $(DEPS) to be empty. Please clarify.

Jan

#2 lore raw
Quoted 14 lines · Jan Beulich

xen/Makefile _clean: delete-unfresh-files · line 91

Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 24.11.15 at 17:56, <[email protected]> wrote:
xen/Makefile +1 -1
@@ -88,7 +88,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core $(DEPS)

Is this really a problem only in xen/ ? The referenced commit clearly introduces "stray" *.d files elsewhere. Also there aren't any source files in xen/, so I'd expect $(DEPS) to be empty. Please clarify.

Quoted 2 lines

Jan

Andrew Cooper, myself and the author see the following after running make && make clean without this patch:

$ ls -la xen
total 124
drwxrwxr-x 10 doug doug  4096 Nov 24 11:09 .
drwxrwxr-x 12 doug doug  4096 Nov 24 10:53 ..
drwxrwxr-x  4 doug doug  4096 Sep 16 10:48 arch
drwxrwxr-x 10 doug doug 12288 Nov 24 11:09 common
-rw-rw-r--  1 doug doug 19116 Jul 31 09:55 COPYING
drwxrwxr-x  2 doug doug  4096 Nov 24 11:09 crypto
drwxrwxr-x  8 doug doug  4096 Nov 24 11:09 drivers
drwxrwxr-x 13 doug doug  4096 Nov 24 11:09 include
-rw-rw-r--  1 doug doug   502 Nov 24 10:53 Kconfig
-rw-rw-r--  1 doug doug  8639 Nov 24 10:53 Makefile
-rw-rw-r--  1 doug doug  5840 Nov 24 10:55 Rules.mk
drwxrwxr-x  3 doug doug  4096 Nov 24 10:53 scripts
drwxrwxr-x  2 doug doug  4096 Nov 24 11:09 tools
-rw-rw-r--  1 doug doug   279 Nov 24 11:00 ..xen.efi.0r.o.d
-rw-rw-r--  1 doug doug   374 Nov 24 11:00 ..xen.efi.0s.o.d
-rw-rw-r--  1 doug doug   279 Nov 24 11:00 ..xen.efi.1r.o.d
-rw-rw-r--  1 doug doug   374 Nov 24 11:00 ..xen.efi.1s.o.d
-rw-rw-r--  1 doug doug   374 Nov 24 11:00 ..xen-syms.0.o.d
-rw-rw-r--  1 doug doug   374 Nov 24 11:00 ..xen-syms.1.o.d
drwxrwxr-x  3 doug doug  4096 Nov 24 11:09 xsm
Signature · 1 line
Doug Goldstein

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

#3 lore raw
In reply to Jan Beulich
Quoted 16 lines · Jan Beulich

xen/Makefile _clean: delete-unfresh-files · line 91

Quoted 10 lines
Quoted 2 lines
Quoted 2 lines · On 24.11.15 at 17:56, <[email protected]> wrote:
xen/Makefile +1 -1
@@ -88,7 +88,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core $(DEPS)

Is this really a problem only in xen/ ? The referenced commit clearly introduces "stray" *.d files elsewhere. Also there aren't any source files in xen/, so I'd expect $(DEPS) to be empty. Please clarify.

So, the files in xen/ were the dependencies files for xen.efi and xen-syms that were getting left behind. $(DEPS) appears to always have ‘.*.d’ in it, based on me putting an echo into the clean rule to print it out. However, looking at this, I am also seeing ‘.d’ files left behind in xen/common/compat that I did not notice before.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
Quoted 20 lines · Jonathan Creekmore
Quoted 17 lines · Jan Beulich

xen/Makefile _clean: delete-unfresh-files · line 91

Quoted 10 lines
Quoted 2 lines
Quoted 2 lines · On 24.11.15 at 17:56, <[email protected]> wrote:
xen/Makefile +1 -1
@@ -88,7 +88,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms *~ core $(DEPS)

Is this really a problem only in xen/ ? The referenced commit clearly introduces "stray" *.d files elsewhere. Also there aren't any source files in xen/, so I'd expect $(DEPS) to be empty. Please clarify.

Quoted 5 lines

So, the files in xen/ were the dependencies files for xen.efi and xen-syms that were getting left behind. $(DEPS) appears to always have ‘.*.d’ in it, based on me putting an echo into the clean rule to print it out. However, looking at this, I am also seeing ‘.d’ files left behind in xen/common/compat that I did not notice before.

Actually, looking closer at it, xen/common/compat does not appear to be cleaning at all, so I think that is a separate, unrelated issue.

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

#5 lore raw
Quoted 21 lines
Quoted 3 lines
Quoted 1 line · On 24.11.15 at 18:22, <[email protected]> wrote:

On Nov 24, 2015, at 11:16 AM, Jonathan Creekmore

Quoted 9 lines · <[email protected]> wrote:
Quoted 9 lines · Jan Beulich

xen/Makefile _clean: delete-unfresh-files · line 91

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 24.11.15 at 17:56, <[email protected]> wrote:
xen/Makefile +0 -1
@@ -88,7 +88,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms 

*~ core

Quoted 1 line
Quoted 1 line

xen/Makefile _clean: delete-unfresh-files · line 91

Quoted 1 line
xen/Makefile +1 -0
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms 

*~ core $(DEPS)

Quoted 5 lines
Quoted 4 lines

Is this really a problem only in xen/ ? The referenced commit clearly introduces "stray" *.d files elsewhere. Also there aren't any source files in xen/, so I'd expect $(DEPS) to be empty. Please clarify.

Quoted 8 lines
Quoted 5 lines

So, the files in xen/ were the dependencies files for xen.efi and xen-syms that were getting left behind. $(DEPS) appears to always have ‘.*.d’ in it, based on me putting an echo into the clean rule to print it out. However, looking at this, I am also seeing ‘.d’ files left behind in xen/common/compat that I did not notice before.

Actually, looking closer at it, xen/common/compat does not appear to be cleaning at all, so I think that is a separate, unrelated issue.

That would be quite related, as it would be a result of the same commit.

Jan

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

#6 lore raw
Quoted 30 lines · Jan Beulich
Quoted 28 lines
Quoted 4 lines
Quoted 2 lines · On 24.11.15 at 18:22, <[email protected]> wrote:

On Nov 24, 2015, at 11:16 AM, Jonathan Creekmore

Quoted 9 lines · <[email protected]> wrote:
Quoted 9 lines · Jan Beulich

xen/Makefile _clean: delete-unfresh-files · line 91

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 24.11.15 at 17:56, <[email protected]> wrote:
xen/Makefile +0 -1
@@ -88,7 +88,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms 

*~ core

Quoted 1 line
Quoted 1 line

xen/Makefile _clean: delete-unfresh-files · line 91

Quoted 1 line
xen/Makefile +1 -0
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms 

*~ core $(DEPS)

Quoted 10 lines
Quoted 4 lines

Is this really a problem only in xen/ ? The referenced commit clearly introduces "stray" *.d files elsewhere. Also there aren't any source files in xen/, so I'd expect $(DEPS) to be empty. Please clarify.

So, the files in xen/ were the dependencies files for xen.efi and xen-syms that were getting left behind. $(DEPS) appears to always have ‘.*.d’ in it, based on me putting an echo into the clean rule to print it out. However, looking at this, I am also seeing ‘.d’ files left behind in xen/common/compat that I did not notice before.

Quoted 5 lines
Quoted 2 lines

Actually, looking closer at it, xen/common/compat does not appear to be cleaning at all, so I think that is a separate, unrelated issue.

That would be quite related, as it would be a result of the same commit.

Yeah, I now see where that change got introduced. I don’t see a clear way of cleaning those objects files since the build system no longer goes into the common/compat directory at all. The existing clean rules walk all of the subdirectories, cleaning object files and dependency files as it goes.

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

#7 lore raw
Quoted 37 lines
Quoted 31 lines
Quoted 1 line · On 24.11.15 at 19:19, <[email protected]> wrote:
Quoted 27 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line · On 24.11.15 at 18:22, <[email protected]> wrote:

On Nov 24, 2015, at 11:16 AM, Jonathan Creekmore

Quoted 9 lines · <[email protected]> wrote:
Quoted 9 lines · Jan Beulich

xen/Makefile _clean: delete-unfresh-files · line 91

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 24.11.15 at 17:56, <[email protected]> wrote:
xen/Makefile +0 -1
@@ -88,7 +88,7 @@ _clean: delete-unfresh-files
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C xsm clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C crypto clean
 	$(MAKE) -f $(BASEDIR)/Rules.mk -C arch/$(TARGET_ARCH) clean
-	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms 

*~ core

Quoted 1 line
Quoted 1 line

xen/Makefile _clean: delete-unfresh-files · line 91

Quoted 1 line
xen/Makefile +1 -0
+	rm -f include/asm *.o $(TARGET) $(TARGET).gz $(TARGET).efi $(TARGET)-syms 

*~ core $(DEPS)

Quoted 10 lines
Quoted 4 lines

Is this really a problem only in xen/ ? The referenced commit clearly introduces "stray" *.d files elsewhere. Also there aren't any source files in xen/, so I'd expect $(DEPS) to be empty. Please clarify.

So, the files in xen/ were the dependencies files for xen.efi and xen-syms that were getting left behind. $(DEPS) appears to always have ‘.*.d’ in it, based on me putting an echo into the clean rule to print it out. However, looking at this, I am also seeing ‘.d’ files left behind in xen/common/compat that I did not notice before.

Quoted 5 lines
Quoted 2 lines

Actually, looking closer at it, xen/common/compat does not appear to be cleaning at all, so I think that is a separate, unrelated issue.

That would be quite related, as it would be a result of the same commit.

Quoted 7 lines

Yeah, I now see where that change got introduced. I don’t see a clear way of cleaning
those objects files since the build system no longer goes into the common/compat directory at
all. The existing clean rules walk all of the subdirectories, cleaning object files and dependency
files as it goes.

But wouldn't the way DEPS gets populated in xen/Rules.mk cover for this? If so, the alternative to your original patch might be to simply rm those ..xen*.o.d files right in the $(TARGET)-syms and $(TARGET).efi rules (along with their corresponding $(@D)/.$(@F).[0-9]* getting removed, due to which those .o.d ones are of no use anyway). Or maybe it should really do both, considering that *.o get removed by _clean too.

Jan

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

#8 lore raw
Quoted 32 lines · Jan Beulich
Quoted 22 lines
Quoted 16 lines
Quoted 2 lines · On 24.11.15 at 19:19, <[email protected]> wrote:
Quoted 11 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line · On 24.11.15 at 18:22, <[email protected]> wrote:

On Nov 24, 2015, at 11:16 AM, Jonathan Creekmore

Quoted 6 lines · <[email protected]> wrote:

So, the files in xen/ were the dependencies files for xen.efi and xen-syms that were getting left behind. $(DEPS) appears to always have ‘.*.d’ in it, based on me putting an echo into the clean rule to print it out. However, looking at this, I am also seeing ‘.d’ files left behind in xen/common/compat that I did not notice before.

Quoted 5 lines
Quoted 2 lines

Actually, looking closer at it, xen/common/compat does not appear to be cleaning at all, so I think that is a separate, unrelated issue.

That would be quite related, as it would be a result of the same commit.

Quoted 7 lines

Yeah, I now see where that change got introduced. I don’t see a clear way of cleaning
those objects files since the build system no longer goes into the common/compat directory at
all. The existing clean rules walk all of the subdirectories, cleaning object files and dependency
files as it goes.

Quoted 8 lines

But wouldn't the way DEPS gets populated in xen/Rules.mk cover for this? If so, the alternative to your original patch might be to simply rm those ..xen*.o.d files right in the $(TARGET)-syms and $(TARGET).efi rules (along with their corresponding $(@D)/.$(@F).[0-9]* getting removed, due to which those .o.d ones are of no use anyway). Or maybe it should really do both, considering that *.o get removed by _clean too.

So, I think we are talking a bit at cross purposes here. There are two problems as I see it:

1. Dependency files get left in the xen/ directory for xen and xen-syms. Those dependency files just started appearing in the xen/ directory when the dependency generation was redone and the clean rule for the top-level directory did not handle cleaning dependency files in the top-level, because it has no source files. That is what my patch was specifically aiming at fixing. The way DEPS gets populated in xen/Rules.mk does cover it, but since DEPS was never in that top-level directory, it wasn’t clearing the dep files that were left in that directory.

However, you could make the argument that the real problem is that the dependency files are being dropped in that directory in the first place.

2. The xen/common/compat directory is not being cleaned at all, although there are .o and .o.d files left in that directory. My patch does not handle that and was never meant to handle that. Given the way the clean rule works, I don’t see how to clean out the files in that directory now that it is no longer in the subdir-y list without just special casing it, which is kind of gross.

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

#9 lore raw
Quoted 55 lines
Quoted 34 lines
Quoted 1 line · On 25.11.15 at 14:07, <[email protected]> wrote:
Quoted 21 lines · Jan Beulich
Quoted 15 lines
Quoted 1 line · On 24.11.15 at 19:19, <[email protected]> wrote:
Quoted 11 lines · Jan Beulich
Quoted 3 lines
Quoted 1 line · On 24.11.15 at 18:22, <[email protected]> wrote:

On Nov 24, 2015, at 11:16 AM, Jonathan Creekmore

Quoted 6 lines · <[email protected]> wrote:

So, the files in xen/ were the dependencies files for xen.efi and xen-syms that were getting left behind. $(DEPS) appears to always have ‘.*.d’ in it, based on me putting an echo into the clean rule to print it out. However, looking at this, I am also seeing ‘.d’ files left behind in xen/common/compat that I did not notice before.

Quoted 5 lines
Quoted 2 lines

Actually, looking closer at it, xen/common/compat does not appear to be cleaning at all, so I think that is a separate, unrelated issue.

That would be quite related, as it would be a result of the same commit.

Quoted 8 lines

Yeah, I now see where that change got introduced. I don’t see a clear way of

cleaning
those objects files since the build system no longer goes into the common/compat directory at
all. The existing clean rules walk all of the subdirectories, cleaning object files and dependency
files as it goes.

Quoted 8 lines

But wouldn't the way DEPS gets populated in xen/Rules.mk cover for this? If so, the alternative to your original patch might be to simply rm those ..xen*.o.d files right in the $(TARGET)-syms and $(TARGET).efi rules (along with their corresponding $(@D)/.$(@F).[0-9]* getting removed, due to which those .o.d ones are of no use anyway). Or maybe it should really do both, considering that *.o get removed by _clean too.

So, I think we are talking a bit at cross purposes here. There are two problems as I see it:

1. Dependency files get left in the xen/ directory for xen and xen-syms. Those dependency files just started appearing in the xen/ directory when the dependency generation was redone and the clean rule for the top-level directory did not handle cleaning dependency files in the top-level, because it has no source files. That is what my patch was specifically aiming at fixing. The way DEPS gets populated in xen/Rules.mk does cover it, but since DEPS was never in that top-level directory, it wasn’t clearing the dep files that were left in that directory.

Quoted 2 lines

However, you could make the argument that the real problem is that the dependency files are being dropped in that directory in the first place.

Even if the rule deleted them, a failed or interrupted build could leave them there. I'll therefore apply your patch as is.

Quoted 7 lines

2. The xen/common/compat directory is not being cleaned at all, although there are .o and .o.d files left in that directory. My patch does not handle that
and was never meant to handle that. Given the way the clean rule works, I don’t see how to clean out the files in that directory now that it is no longer
in the subdir-y list without just special casing it, which is kind of gross.

This actually points out a worse problem: Dependencies are currently broken for all the files built from their parent directory. I wrongly used $(basename ...) in the DEPS generation, which I'll send a patch for shortly. Once fixed, the "clean" aspect will be fixed at once.

Jan

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