[PATCH] build: add "make uninstall" target

Paolo Bonzini posted 1 patch 3 years, 4 months ago
Test checkpatch passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20201118165340.166821-1-pbonzini@redhat.com
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] build: add "make uninstall" target
Posted by Paolo Bonzini 3 years, 4 months ago
Do not hide the ninja "uninstall" target, so that "make uninstall" forwards
the request to "ninja uninstall".

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Fixes: https://bugs.launchpad.net/qemu/+bug/1371915
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 76dbb917f5..da01e3cd16 100644
--- a/Makefile
+++ b/Makefile
@@ -156,7 +156,7 @@ NINJAFLAGS = $(if $V,-v) $(if $(MAKE.n), -n) $(if $(MAKE.k), -k0) \
 ninja-cmd-goals = $(or $(MAKECMDGOALS), all)
 ninja-cmd-goals += $(foreach t, $(.tests), $(.test.deps.$t))
 
-makefile-targets := build.ninja ctags TAGS cscope dist clean uninstall
+makefile-targets := build.ninja ctags TAGS cscope dist clean
 # "ninja -t targets" also lists all prerequisites.  If build system
 # files are marked as PHONY, however, Make will always try to execute
 # "ninja build.ninja".
-- 
2.28.0


Re: [PATCH] build: add "make uninstall" target
Posted by Peter Maydell 3 years, 4 months ago
On Wed, 18 Nov 2020 at 16:53, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> Do not hide the ninja "uninstall" target, so that "make uninstall" forwards
> the request to "ninja uninstall".
>
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Fixes: https://bugs.launchpad.net/qemu/+bug/1371915
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Doesn't quite work, sadly:

[...]
Deleted: /tmp/qemu-inst/usr/local/share/doc/qemu/system/i386
Deleted: /tmp/qemu-inst/usr/local/share/doc/qemu/system
Deleted: /tmp/qemu-inst/usr/local/share/doc/qemu/specs/_static
Deleted: /tmp/qemu-inst/usr/local/share/doc/qemu/specs
Deleted: /tmp/qemu-inst/usr/local/share/doc/qemu/tools/_static
Deleted: /tmp/qemu-inst/usr/local/share/doc/qemu/tools
Deleted: /tmp/qemu-inst/usr/local/share/doc/qemu/interop/_static
Deleted: /tmp/qemu-inst/usr/local/share/doc/qemu/interop
Deleted: /tmp/qemu-inst/usr/local/share/doc/qemu
Deleted: /tmp/qemu-inst/usr/local/share/doc
Could not delete /tmp/qemu-inst/usr/local/share: [Errno 39] Directory
not empty: '/tmp/qemu-inst/usr/local/share'.
Deleted: /tmp/qemu-inst/usr/local/var/run
Deleted: /tmp/qemu-inst/usr/local/var
Could not delete /tmp/qemu-inst/usr/local: [Errno 39] Directory not
empty: '/tmp/qemu-inst/usr/local'.
Could not delete /tmp/qemu-inst/usr: [Errno 39] Directory not empty:
'/tmp/qemu-inst/usr'.
Could not delete /tmp/qemu-inst: [Errno 39] Directory not empty:
'/tmp/qemu-inst'.

Uninstall finished.

Deleted: 415
Failed: 4

Remember that files created by custom scripts have not been removed.

and these files are left in the install tree:

/tmp/qemu-inst/usr/local/share/locale/it/LC_MESSAGES/qemu.mo
/tmp/qemu-inst/usr/local/share/locale/de_DE/LC_MESSAGES/qemu.mo
/tmp/qemu-inst/usr/local/share/locale/bg/LC_MESSAGES/qemu.mo
/tmp/qemu-inst/usr/local/share/locale/hu/LC_MESSAGES/qemu.mo
/tmp/qemu-inst/usr/local/share/locale/fr_FR/LC_MESSAGES/qemu.mo
/tmp/qemu-inst/usr/local/share/locale/zh_CN/LC_MESSAGES/qemu.mo
/tmp/qemu-inst/usr/local/share/locale/tr/LC_MESSAGES/qemu.mo
/tmp/qemu-inst/usr/local/share/locale/sv/LC_MESSAGES/qemu.mo

AIUI these are installed by meson's i18n module, so it seems like
a meson bug that that module doesn't play nicely with meson's
uninstall functionality. Looks like this was reported to meson
upstream in 2017, still not fixed:
https://github.com/mesonbuild/meson/issues/1601

thanks
-- PMM