* [RFC PATCH v2] tests/vm: avoid re-building the VM images all the time
@ 2024-02-26 19:50 Alex Bennée
2024-03-11 10:52 ` Thomas Huth
0 siblings, 1 reply; 2+ messages in thread
From: Alex Bennée @ 2024-02-26 19:50 UTC (permalink / raw)
To: qemu-devel
Cc: Alex Bennée, Philippe Mathieu-Daudé, Thomas Huth,
Wainer dos Santos Moschetta, Beraldo Leal
The main problem is that "check-venv" is a .PHONY target will always
evaluate and trigger a full re-build of the VM images. While its
tempting to drop it from the dependencies that does introduce a
breakage on freshly configured builds.
Fortunately we do have the otherwise redundant --force flag for the
script which up until now was always on. If we make the usage of
--force conditional on dependencies other than check-venv triggering
the update we can avoid the costly rebuild and still run cleanly on a
fresh checkout.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2118
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
tests/vm/Makefile.include | 2 +-
tests/vm/basevm.py | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index bf12e0fa3c5..ac56824a87d 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -102,7 +102,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \
$(if $(LOG_CONSOLE),--log-console) \
--source-path $(SRC_PATH) \
--image "$@" \
- --force \
+ $(if $(filter-out check-venv, $?), --force) \
--build-image $@, \
" VM-IMAGE $*")
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index c0d62c08031..f8fd751eb14 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -646,9 +646,9 @@ def main(vmcls, config=None):
vm = vmcls(args, config=config)
if args.build_image:
if os.path.exists(args.image) and not args.force:
- sys.stderr.writelines(["Image file exists: %s\n" % args.image,
+ sys.stderr.writelines(["Image file exists, skipping build: %s\n" % args.image,
"Use --force option to overwrite\n"])
- return 1
+ return 0
return vm.build_image(args.image)
if args.build_qemu:
vm.add_source_dir(args.build_qemu)
--
2.39.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC PATCH v2] tests/vm: avoid re-building the VM images all the time
2024-02-26 19:50 [RFC PATCH v2] tests/vm: avoid re-building the VM images all the time Alex Bennée
@ 2024-03-11 10:52 ` Thomas Huth
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Huth @ 2024-03-11 10:52 UTC (permalink / raw)
To: Alex Bennée, qemu-devel
Cc: Philippe Mathieu-Daudé, Wainer dos Santos Moschetta,
Beraldo Leal
On 26/02/2024 20.50, Alex Bennée wrote:
> The main problem is that "check-venv" is a .PHONY target will always
> evaluate and trigger a full re-build of the VM images. While its
> tempting to drop it from the dependencies that does introduce a
> breakage on freshly configured builds.
>
> Fortunately we do have the otherwise redundant --force flag for the
> script which up until now was always on. If we make the usage of
> --force conditional on dependencies other than check-venv triggering
> the update we can avoid the costly rebuild and still run cleanly on a
> fresh checkout.
>
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2118
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
> tests/vm/Makefile.include | 2 +-
> tests/vm/basevm.py | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
> index bf12e0fa3c5..ac56824a87d 100644
> --- a/tests/vm/Makefile.include
> +++ b/tests/vm/Makefile.include
> @@ -102,7 +102,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \
> $(if $(LOG_CONSOLE),--log-console) \
> --source-path $(SRC_PATH) \
> --image "$@" \
> - --force \
> + $(if $(filter-out check-venv, $?), --force) \
> --build-image $@, \
> " VM-IMAGE $*")
>
> diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
> index c0d62c08031..f8fd751eb14 100644
> --- a/tests/vm/basevm.py
> +++ b/tests/vm/basevm.py
> @@ -646,9 +646,9 @@ def main(vmcls, config=None):
> vm = vmcls(args, config=config)
> if args.build_image:
> if os.path.exists(args.image) and not args.force:
> - sys.stderr.writelines(["Image file exists: %s\n" % args.image,
> + sys.stderr.writelines(["Image file exists, skipping build: %s\n" % args.image,
> "Use --force option to overwrite\n"])
> - return 1
> + return 0
> return vm.build_image(args.image)
> if args.build_qemu:
> vm.add_source_dir(args.build_qemu)
Reviewed-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-03-11 10:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-26 19:50 [RFC PATCH v2] tests/vm: avoid re-building the VM images all the time Alex Bennée
2024-03-11 10:52 ` Thomas Huth
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).