@samitouri / QOSamiQemu / commits / 2d3d5ae1ad

tests/docker: allow display of docker output

The --quiet command is used with docker unless V=1 is passed to make, and as a result stdout from docker is never visible by default, making it hard to diagnose failures building / running containers. Meanwhile passing V=1 is undesirable as that makes the entire build system verbose. Introduce a $(DOCKER_V) make variable which is initialized from $(V) It is thus possible to display docker output without also enabling make verbose output. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-ID: <20260210163556.713841-4-berrange@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>

Daniel P. Berrangé committed Feb 10, 2026 at 16:35 UTC 2d3d5ae1addba5ab8af67eaab3ac055394305db8
1 file changed +13 -7
tests/docker/Makefile.include
+13 -7
@@ -23,6 +23,8 @@ RUNC ?= $(shell $(DOCKER_SCRIPT) probe)
23 CUR_TIME := $(shell date +%Y-%m-%d-%H.%M.%S.$$$$)
24 DOCKER_SRC_COPY := $(BUILD_DIR)/docker-src.$(CUR_TIME)
25
26 +DOCKER_V ?= $(V)
27 +
28 .DELETE_ON_ERROR: $(DOCKER_SRC_COPY)
29 $(DOCKER_SRC_COPY):
30 @mkdir $@
@@ -40,14 +42,14 @@ docker-qemu-src: $(DOCKER_SRC_COPY)
42 docker-image-%: $(DOCKER_FILES_DIR)/%.docker
43 $(call quiet-command, \
44 DOCKER_BUILDKIT=1 $(RUNC) build \
43 - $(if $V,,--quiet) \
45 + $(if $(DOCKER_V),,--quiet) \
46 $(if $(NOCACHE),--no-cache, \
47 $(if $(DOCKER_REGISTRY),--cache-from $(DOCKER_REGISTRY)/qemu/$*)) \
48 --build-arg BUILDKIT_INLINE_CACHE=1 \
49 $(if $(NOUSER),, \
50 --build-arg USER=$(USER) \
51 --build-arg UID=$(UID)) \
50 - -t qemu/$* - < $< $(if $V,,> /dev/null),\
52 + -t qemu/$* - < $< $(if $(DOCKER_V),,> /dev/null),\
53 "BUILD", $*)
54
55 # General rule for inspecting registry images.
@@ -73,7 +75,7 @@ docker-binfmt-image-debian-%: $(DOCKER_FILES_DIR)/debian-bootstrap.docker
75 DEB_TYPE=$(DEB_TYPE) \
76 $(if $(DEB_URL),DEB_URL=$(DEB_URL),) \
77 $(DOCKER_SCRIPT) build -t qemu/debian-$* -f $< \
76 - $(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \
78 + $(if $(DOCKER_V),,--quiet) $(if $(NOCACHE),--no-cache) \
79 $(if $(NOUSER),,--add-current-user) \
80 $(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES)) \
81 $(if $(EXECUTABLE),--include-executable=$(EXECUTABLE)), \
@@ -105,16 +107,17 @@ debian-toolchain-run = \
107 $(if $(NOCACHE)$(NOFETCH), \
108 $(call quiet-command, \
109 $(DOCKER_SCRIPT) build -t qemu/$1 -f $< \
108 - $(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \
110 + $(if $(DOCKER_V),,--quiet) \
111 + $(if $(NOCACHE),--no-cache) \
112 --registry $(DOCKER_REGISTRY) --extra-files \
113 $(DOCKER_FILES_DIR)/$1.d/build-toolchain.sh, \
114 "BUILD", $1), \
115 $(call quiet-command, \
113 - $(DOCKER_SCRIPT) fetch $(if $V,,--quiet) \
116 + $(DOCKER_SCRIPT) fetch $(if $(DOCKER_V),,--quiet) \
117 qemu/$1 $(DOCKER_REGISTRY), \
118 "FETCH", $1) \
119 $(call quiet-command, \
117 - $(DOCKER_SCRIPT) update $(if $V,,--quiet) \
120 + $(DOCKER_SCRIPT) update $(if $(DOCKER_V),,--quiet) \
121 qemu/$1 \
122 $(if $(NOUSER),,--add-current-user) \
123 "PREPARE", $1))
@@ -231,7 +234,10 @@ docker-run: docker-qemu-src
234 -e TARGET_LIST=$(subst $(SPACE),$(COMMA),$(TARGET_LIST)) \
235 -e EXTRA_CONFIGURE_OPTS="$(EXTRA_CONFIGURE_OPTS)" \
236 -e TEST_COMMAND="$(TEST_COMMAND)" \
234 - -e V=$V -e J=$J -e DEBUG=$(DEBUG) \
237 + -e V=$V \
238 + -e DOCKER_V=$(DOCKER_V) \
239 + -e J=$J \
240 + -e DEBUG=$(DEBUG) \
241 -e SHOW_ENV=$(SHOW_ENV) \
242 $(if $(NOUSER),, \
243 -v $(DOCKER_QEMU_CACHE_DIR):$(DOCKER_QEMU_CACHE_DIR) \