* [PATCH 0/3] makefile fixes/cleanups
@ 2023-05-25 10:28 Paolo Bonzini
2023-05-25 10:28 ` [PATCH 1/3] tests/docker: simplify HOST_ARCH definition Paolo Bonzini
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Paolo Bonzini @ 2023-05-25 10:28 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, jsnow
A few fixes for things that have gotten inconsistent or redundant
over many changes to Makefile.
Paolo
Paolo Bonzini (3):
tests/docker: simplify HOST_ARCH definition
tests/vm: fix and simplify HOST_ARCH definition
Makefile: remove $(TESTS_PYTHON)
tests/Makefile.include | 8 +++-----
tests/docker/Makefile.include | 2 +-
tests/vm/Makefile.include | 7 +++----
3 files changed, 7 insertions(+), 10 deletions(-)
--
2.40.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH 1/3] tests/docker: simplify HOST_ARCH definition
2023-05-25 10:28 [PATCH 0/3] makefile fixes/cleanups Paolo Bonzini
@ 2023-05-25 10:28 ` Paolo Bonzini
2023-05-25 11:49 ` Philippe Mathieu-Daudé
2023-05-25 13:30 ` Alex Bennée
2023-05-25 10:28 ` [PATCH 2/3] tests/vm: fix and " Paolo Bonzini
2023-05-25 10:28 ` [PATCH 3/3] Makefile: remove $(TESTS_PYTHON) Paolo Bonzini
2 siblings, 2 replies; 9+ messages in thread
From: Paolo Bonzini @ 2023-05-25 10:28 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, jsnow
ARCH is always empty, so just define HOST_ARCH as the result of uname.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/docker/Makefile.include | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 94015253254c..142e8605eee9 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -6,7 +6,7 @@ NULL :=
SPACE := $(NULL) #
COMMA := ,
-HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m))
+HOST_ARCH = $(shell uname -m)
USER = $(if $(NOUSER),,$(shell id -un))
UID = $(if $(NOUSER),,$(shell id -u))
--
2.40.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/3] tests/vm: fix and simplify HOST_ARCH definition
2023-05-25 10:28 [PATCH 0/3] makefile fixes/cleanups Paolo Bonzini
2023-05-25 10:28 ` [PATCH 1/3] tests/docker: simplify HOST_ARCH definition Paolo Bonzini
@ 2023-05-25 10:28 ` Paolo Bonzini
2023-05-25 13:31 ` Alex Bennée
2023-05-25 10:28 ` [PATCH 3/3] Makefile: remove $(TESTS_PYTHON) Paolo Bonzini
2 siblings, 1 reply; 9+ messages in thread
From: Paolo Bonzini @ 2023-05-25 10:28 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, jsnow
ARCH is always empty, so just define HOST_ARCH as the result of uname.
The incorrect definition was not being used because the "ifeq" statement
is wrong; replace it with the same idiom based on $(realpath) that the
main Makefile uses.
With this change, vm-build-netbsd in a configured tree will not use
the PYTHONPATH hack.
Reported-by: John Snow <jsnow@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/vm/Makefile.include | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index 2cc2203d0916..c2a8ca1c175a 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -1,14 +1,12 @@
# Makefile for VM tests
# Hack to allow running in an unconfigured build tree
-ifeq ($(wildcard $(SRC_PATH)/config-host.mak),)
+ifeq ($(realpath $(SRC_PATH)),$(realpath .))
VM_PYTHON = PYTHONPATH=$(SRC_PATH)/python /usr/bin/env python3
VM_VENV =
-HOST_ARCH := $(shell uname -m)
else
VM_PYTHON = $(TESTS_PYTHON)
VM_VENV = check-venv
-HOST_ARCH = $(ARCH)
endif
.PHONY: vm-build-all vm-clean-all
@@ -23,6 +21,7 @@ ARM64_IMAGES += ubuntu.aarch64 centos.aarch64
endif
endif
+HOST_ARCH = $(shell uname -m)
ifeq ($(HOST_ARCH),x86_64)
IMAGES=$(X86_IMAGES) $(if $(USE_TCG),$(ARM64_IMAGES))
else ifeq ($(HOST_ARCH),aarch64)
--
2.40.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/3] Makefile: remove $(TESTS_PYTHON)
2023-05-25 10:28 [PATCH 0/3] makefile fixes/cleanups Paolo Bonzini
2023-05-25 10:28 ` [PATCH 1/3] tests/docker: simplify HOST_ARCH definition Paolo Bonzini
2023-05-25 10:28 ` [PATCH 2/3] tests/vm: fix and " Paolo Bonzini
@ 2023-05-25 10:28 ` Paolo Bonzini
2023-05-25 13:30 ` Alex Bennée
2023-05-25 21:09 ` John Snow
2 siblings, 2 replies; 9+ messages in thread
From: Paolo Bonzini @ 2023-05-25 10:28 UTC (permalink / raw)
To: qemu-devel; +Cc: alex.bennee, jsnow
It is now the same as $(PYTHON), since the latter always points at pyvenv/bin/python3.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/Makefile.include | 8 +++-----
tests/vm/Makefile.include | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 5b838ec438b0..0184ef223737 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -89,11 +89,9 @@ distclean-tcg: $(DISTCLEAN_TCG_TARGET_RULES)
# Build up our target list from the filtered list of ninja targets
TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))
-TESTS_VENV_DIR=$(BUILD_DIR)/pyvenv
TESTS_VENV_TOKEN=$(BUILD_DIR)/pyvenv/tests.group
TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
-TESTS_PYTHON=$(TESTS_VENV_DIR)/bin/python3
ifndef AVOCADO_TESTS
AVOCADO_TESTS=tests/avocado
endif
@@ -109,7 +107,7 @@ else
endif
quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
- $(TESTS_PYTHON) -m pip -q --disable-pip-version-check $1, \
+ $(PYTHON) -m pip -q --disable-pip-version-check $1, \
"VENVPIP","$1")
$(TESTS_VENV_TOKEN): $(TESTS_VENV_REQ)
@@ -131,7 +129,7 @@ FEDORA_31_DOWNLOAD=$(filter $(FEDORA_31_ARCHES),$(FEDORA_31_ARCHES_CANDIDATES))
# download one specific Fedora 31 image
get-vm-image-fedora-31-%: check-venv
$(call quiet-command, \
- $(TESTS_PYTHON) -m avocado vmimage get \
+ $(PYTHON) -m avocado vmimage get \
--distro=fedora --distro-version=31 --arch=$*, \
"AVOCADO", "Downloading avocado tests VM image for $*")
@@ -142,7 +140,7 @@ JOBS_OPTION=$(lastword -j1 $(filter-out -j, $(filter -j%,$(MAKEFLAGS))))
check-avocado: check-venv $(TESTS_RESULTS_DIR) get-vm-images
$(call quiet-command, \
- $(TESTS_PYTHON) -m avocado \
+ $(PYTHON) -m avocado \
--show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
$(if $(AVOCADO_TAGS),, \
--filter-by-tags-include-empty \
diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index c2a8ca1c175a..f0f5d32fb0f0 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -5,7 +5,7 @@ ifeq ($(realpath $(SRC_PATH)),$(realpath .))
VM_PYTHON = PYTHONPATH=$(SRC_PATH)/python /usr/bin/env python3
VM_VENV =
else
-VM_PYTHON = $(TESTS_PYTHON)
+VM_PYTHON = $(PYTHON)
VM_VENV = check-venv
endif
--
2.40.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] tests/docker: simplify HOST_ARCH definition
2023-05-25 10:28 ` [PATCH 1/3] tests/docker: simplify HOST_ARCH definition Paolo Bonzini
@ 2023-05-25 11:49 ` Philippe Mathieu-Daudé
2023-05-25 13:30 ` Alex Bennée
1 sibling, 0 replies; 9+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-05-25 11:49 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: alex.bennee, jsnow
On 25/5/23 12:28, Paolo Bonzini wrote:
> ARCH is always empty, so just define HOST_ARCH as the result of uname.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> tests/docker/Makefile.include | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/3] tests/docker: simplify HOST_ARCH definition
2023-05-25 10:28 ` [PATCH 1/3] tests/docker: simplify HOST_ARCH definition Paolo Bonzini
2023-05-25 11:49 ` Philippe Mathieu-Daudé
@ 2023-05-25 13:30 ` Alex Bennée
1 sibling, 0 replies; 9+ messages in thread
From: Alex Bennée @ 2023-05-25 13:30 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, jsnow
Paolo Bonzini <pbonzini@redhat.com> writes:
> ARCH is always empty, so just define HOST_ARCH as the result of uname.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] Makefile: remove $(TESTS_PYTHON)
2023-05-25 10:28 ` [PATCH 3/3] Makefile: remove $(TESTS_PYTHON) Paolo Bonzini
@ 2023-05-25 13:30 ` Alex Bennée
2023-05-25 21:09 ` John Snow
1 sibling, 0 replies; 9+ messages in thread
From: Alex Bennée @ 2023-05-25 13:30 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, jsnow
Paolo Bonzini <pbonzini@redhat.com> writes:
> It is now the same as $(PYTHON), since the latter always points at pyvenv/bin/python3.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/3] tests/vm: fix and simplify HOST_ARCH definition
2023-05-25 10:28 ` [PATCH 2/3] tests/vm: fix and " Paolo Bonzini
@ 2023-05-25 13:31 ` Alex Bennée
0 siblings, 0 replies; 9+ messages in thread
From: Alex Bennée @ 2023-05-25 13:31 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, jsnow
Paolo Bonzini <pbonzini@redhat.com> writes:
> ARCH is always empty, so just define HOST_ARCH as the result of uname.
> The incorrect definition was not being used because the "ifeq" statement
> is wrong; replace it with the same idiom based on $(realpath) that the
> main Makefile uses.
>
> With this change, vm-build-netbsd in a configured tree will not use
> the PYTHONPATH hack.
>
> Reported-by: John Snow <jsnow@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/3] Makefile: remove $(TESTS_PYTHON)
2023-05-25 10:28 ` [PATCH 3/3] Makefile: remove $(TESTS_PYTHON) Paolo Bonzini
2023-05-25 13:30 ` Alex Bennée
@ 2023-05-25 21:09 ` John Snow
1 sibling, 0 replies; 9+ messages in thread
From: John Snow @ 2023-05-25 21:09 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: qemu-devel, alex.bennee
On Thu, May 25, 2023 at 6:28 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> It is now the same as $(PYTHON), since the latter always points at pyvenv/bin/python3.
Good point!
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
> ---
> tests/Makefile.include | 8 +++-----
> tests/vm/Makefile.include | 2 +-
> 2 files changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index 5b838ec438b0..0184ef223737 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -89,11 +89,9 @@ distclean-tcg: $(DISTCLEAN_TCG_TARGET_RULES)
> # Build up our target list from the filtered list of ninja targets
> TARGETS=$(patsubst libqemu-%.fa, %, $(filter libqemu-%.fa, $(ninja-targets)))
>
> -TESTS_VENV_DIR=$(BUILD_DIR)/pyvenv
> TESTS_VENV_TOKEN=$(BUILD_DIR)/pyvenv/tests.group
> TESTS_VENV_REQ=$(SRC_PATH)/tests/requirements.txt
> TESTS_RESULTS_DIR=$(BUILD_DIR)/tests/results
> -TESTS_PYTHON=$(TESTS_VENV_DIR)/bin/python3
> ifndef AVOCADO_TESTS
> AVOCADO_TESTS=tests/avocado
> endif
> @@ -109,7 +107,7 @@ else
> endif
>
> quiet-venv-pip = $(quiet-@)$(call quiet-command-run, \
> - $(TESTS_PYTHON) -m pip -q --disable-pip-version-check $1, \
> + $(PYTHON) -m pip -q --disable-pip-version-check $1, \
> "VENVPIP","$1")
>
> $(TESTS_VENV_TOKEN): $(TESTS_VENV_REQ)
> @@ -131,7 +129,7 @@ FEDORA_31_DOWNLOAD=$(filter $(FEDORA_31_ARCHES),$(FEDORA_31_ARCHES_CANDIDATES))
> # download one specific Fedora 31 image
> get-vm-image-fedora-31-%: check-venv
> $(call quiet-command, \
> - $(TESTS_PYTHON) -m avocado vmimage get \
> + $(PYTHON) -m avocado vmimage get \
> --distro=fedora --distro-version=31 --arch=$*, \
> "AVOCADO", "Downloading avocado tests VM image for $*")
>
> @@ -142,7 +140,7 @@ JOBS_OPTION=$(lastword -j1 $(filter-out -j, $(filter -j%,$(MAKEFLAGS))))
>
> check-avocado: check-venv $(TESTS_RESULTS_DIR) get-vm-images
> $(call quiet-command, \
> - $(TESTS_PYTHON) -m avocado \
> + $(PYTHON) -m avocado \
> --show=$(AVOCADO_SHOW) run --job-results-dir=$(TESTS_RESULTS_DIR) \
> $(if $(AVOCADO_TAGS),, \
> --filter-by-tags-include-empty \
> diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
> index c2a8ca1c175a..f0f5d32fb0f0 100644
> --- a/tests/vm/Makefile.include
> +++ b/tests/vm/Makefile.include
> @@ -5,7 +5,7 @@ ifeq ($(realpath $(SRC_PATH)),$(realpath .))
> VM_PYTHON = PYTHONPATH=$(SRC_PATH)/python /usr/bin/env python3
> VM_VENV =
> else
> -VM_PYTHON = $(TESTS_PYTHON)
> +VM_PYTHON = $(PYTHON)
> VM_VENV = check-venv
> endif
>
> --
> 2.40.1
>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2023-05-25 21:10 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-25 10:28 [PATCH 0/3] makefile fixes/cleanups Paolo Bonzini
2023-05-25 10:28 ` [PATCH 1/3] tests/docker: simplify HOST_ARCH definition Paolo Bonzini
2023-05-25 11:49 ` Philippe Mathieu-Daudé
2023-05-25 13:30 ` Alex Bennée
2023-05-25 10:28 ` [PATCH 2/3] tests/vm: fix and " Paolo Bonzini
2023-05-25 13:31 ` Alex Bennée
2023-05-25 10:28 ` [PATCH 3/3] Makefile: remove $(TESTS_PYTHON) Paolo Bonzini
2023-05-25 13:30 ` Alex Bennée
2023-05-25 21:09 ` John Snow
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).