Skip to contentSkip to conversation

build: Fix distclean when repo location changes

PATCH In review Andrei Lifchits 3 participants 5 messages Feb 20, 2013 – Feb 22, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: Fix distclean when repo location changes

If the path to xen-unstable.hg changes (i.e. you move the repo), the symlinks inside xen-unstable.hg/stubdom/libxc-x86_[32|64]/ all become broken, which breaks distclean because make attempts to clean inside those first and fails to find Makefile (which is also a symlink).

stubdom/Makefile +1 -1
diff -r 66f563be41d9 -r 8f69a0bcab52 stubdom/Makefile
@@ -501,7 +501,7 @@ clean:
 	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
-	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
+	[ ! -e libxc-$(XEN_TARGET_ARCH)/Makefile ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
 	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
 	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
#1 lore raw
Quoted 4 lines · Andrei Lifchits

If the path to xen-unstable.hg changes (i.e. you move the repo), the symlinks inside xen-unstable.hg/stubdom/libxc-x86_[32|64]/ all become broken, which breaks distclean because make attempts to clean inside those first and fails to find Makefile (which is also a symlink).

Would it be possible to arrange for the symlinks to be relative in the first place?

Quoted 18 lines

diff -r 66f563be41d9 -r 8f69a0bcab52 stubdom/Makefile

stubdom/Makefile +1 -1
@@ -501,7 +501,7 @@ clean:
 	$(MAKE) -C vtpmmgr clean
 	rm -fr grub-$(XEN_TARGET_ARCH)
 	rm -f $(STUBDOMPATH)
-	[ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
+	[ ! -e libxc-$(XEN_TARGET_ARCH)/Makefile ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
 	-[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
 	-[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
 

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

#2 lore raw
Quoted 5 lines · Ian Campbell
Quoted 4 lines · Andrei Lifchits

If the path to xen-unstable.hg changes (i.e. you move the repo), the symlinks inside xen-unstable.hg/stubdom/libxc-x86_[32|64]/ all become broken, which breaks distclean because make attempts to clean inside those first and fails to find Makefile (which is also a symlink).

Quoted 2 lines

Would it be possible to arrange for the symlinks to be relative in the first place?

Good idea, I'll look into it when I have time (there are a lot of those symlinks in various places).

Quoted 25 lines
Quoted 14 lines

diff -r 66f563be41d9 -r 8f69a0bcab52 stubdom/Makefile

stubdom/Makefile Wed Feb 20 16:36:40 2013 +0000 renamed from stubdom/Makefile Tue Feb 19 10:49:53 2013 +0100 +1 -1
@@ -501,7 +501,7 @@ clean:
      $(MAKE) -C vtpmmgr clean
      rm -fr grub-$(XEN_TARGET_ARCH)
      rm -f $(STUBDOMPATH)
-     [ ! -d libxc-$(XEN_TARGET_ARCH) ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
+     [ ! -e libxc-$(XEN_TARGET_ARCH)/Makefile ] || $(MAKE) DESTDIR= -C libxc-$(XEN_TARGET_ARCH) clean
      -[ ! -d ioemu ] || $(MAKE) DESTDIR= -C ioemu clean
      -[ ! -d xenstore ] || $(MAKE) DESTDIR= -C xenstore clean
 
Quoted 4 lines

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

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

#3 lore raw

Andrei Lifchits writes ("Re: [Xen-devel] [PATCH] build: Fix distclean when repo location changes"):

Quoted 8 lines · Ian Campbell
Quoted 5 lines · Andrei Lifchits
Quoted 4 lines

If the path to xen-unstable.hg changes (i.e. you move the repo), the symlinks inside xen-unstable.hg/stubdom/libxc-x86_[32|64]/ all become broken, which breaks distclean because make attempts to clean inside those first and fails to find Makefile (which is also a symlink).

Thanks, I've applied the patch.

Quoted 5 lines
Quoted 2 lines

Would it be possible to arrange for the symlinks to be relative in the first place?

Good idea, I'll look into it when I have time (there are a lot of those symlinks in various places).

Right. As I say I don't think this is a thing that should be expected to be work but I won't block you from working on it :-).

Making "distclean" work after the tree is moved might be easier than making just "make" still work; the latter would involve making sure that all the -Is etc. were relative, as those paths end up in .d files.

Ian.

#4 lore raw
In reply to Andrei Lifchits

Andrei Lifchits writes ("[Xen-devel] [PATCH] build: Fix distclean when repo location changes"):

Quoted 4 lines

If the path to xen-unstable.hg changes (i.e. you move the repo), the symlinks inside xen-unstable.hg/stubdom/libxc-x86_[32|64]/ all become broken, which breaks distclean because make attempts to clean inside those first and fails to find Makefile (which is also a symlink).

TBH I'm inclined to say "don't do that then". mving the tree about is likely to break things and I don't think we support it.

But your patch is harmless so I'm content to apply it - except that it's missing a s-o-b.

Ie we need your confirmation that the Developer's Certificate of Origin applies. See http://wiki.xen.org/wiki/SubmittingXenPatches

Thanks,
Ian.