[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 48/54] tests: add top-level make dependency for d
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v7 48/54] tests: add top-level make dependency for docker builds |
Date: |
Fri, 15 Jun 2018 20:46:59 +0100 |
One problem with satisfying your docker dependencies in a sub-make it
you might end up trying to satisfy the dependency multiple times. This
is especially a problem with debian-sid based cross compilers and CI
setups. We solve this by doing a docker build pass at the top level
before any sub-makes are called.
We still need to satisfy dependencies in the Makefile.target call so
people can run tests from individual target directories. We introduce
a new Makefile.probe which gets called for each PROBE_TARGET and
allows us to build up the list. It does require multiply including
config-target.mak which shouldn't cause any issues as it shouldn't
define anything that clashes with config-host.mak. However we undefine
a few key variables each time around.
Signed-off-by: Alex Bennée <address@hidden>
---
v7
- remove $(info) spam
- just add the explicit docker dependency to each build target
- include build-tcg-prereqs for CI tasks
---
tests/Makefile.include | 11 +++++++++++
tests/tcg/Makefile.probe | 31 +++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
create mode 100644 tests/tcg/Makefile.probe
diff --git a/tests/Makefile.include b/tests/Makefile.include
index c8faa01a33..2dd0700a88 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -938,6 +938,14 @@ BUILD_TCG_TARGET_RULES=$(patsubst %,build-tcg-tests-%,
$(LINUX_USER_TARGETS))
CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(LINUX_USER_TARGETS))
RUN_TCG_TARGET_RULES=$(patsubst %,run-tcg-tests-%, $(LINUX_USER_TARGETS))
+# Probe for the Docker Builds needed for each build
+DOCKER_BUILD_TARGETS:=
+$(foreach PROBE_TARGET,$(TARGET_LIST), \
+ $(eval -include $(SRC_PATH)/tests/tcg/Makefile.probe) \
+ $(if $(DOCKER_PREREQ), \
+ $(eval DOCKER_BUILD_TARGETS+=$(DOCKER_PREREQ)) \
+ $(eval build-tcg-tests-$(PROBE_TARGET): $(DOCKER_PREREQ))))
+
build-tcg-tests-%:
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)"
TARGET_DIR="$*/" guest-tests,)
@@ -947,6 +955,9 @@ run-tcg-tests-%: build-tcg-tests-%
clean-tcg-tests-%:
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)"
TARGET_DIR="$*/" clean-guest-tests,)
+.PHONY: build-tcg-prereqs
+build-tcg-prereqs: $(DOCKER_BUILD_TARGETS)
+
.PHONY: build-tcg
build-tcg: $(BUILD_TCG_TARGET_RULES)
diff --git a/tests/tcg/Makefile.probe b/tests/tcg/Makefile.probe
new file mode 100644
index 0000000000..15c0412657
--- /dev/null
+++ b/tests/tcg/Makefile.probe
@@ -0,0 +1,31 @@
+# -*- Mode: makefile -*-
+#
+# TCG Compiler Probe
+#
+# This Makefile fragement is included multiple times in the main make
+# script to probe for available compilers. This is used to build up a
+# selection of required docker targets before we invoke a sub-make for
+# each target.
+
+# First we need the target makefile which tells us the target architecture
+-include $(BUILD_DIR)/$(PROBE_TARGET)/config-target.mak
+
+# Then we load up the target architecture makefiles which tell us
+# about the compilers
+CROSS_CC_GUEST:=
+DOCKER_IMAGE:=
+DOCKER_PREREQ:=
+
+-include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.include
+-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include
+
+ifndef CROSS_CC_GUEST
+ifneq ($(DOCKER_IMAGE),)
+DOCKER_PREREQ:=docker-image-$(DOCKER_IMAGE)
+endif
+endif
+
+# Clean-up
+# undefine TARGET_NAME
+# undefine TARGET_BASE_ARCH
+# undefine TARGET_ABI_DIR
--
2.17.1
- [Qemu-devel] [PATCH v7 09/54] tests/tcg: move architecture independent tests into subdir, (continued)
- [Qemu-devel] [PATCH v7 09/54] tests/tcg: move architecture independent tests into subdir, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 22/54] tests/tcg: move ARM specific tests into subdir, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 21/54] tests/tcg/i386/test-i386: fix printf format, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 15/54] tests/tcg: enable building for i386, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 19/54] tests/tcg/x86_64: add Makefile.target, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 54/54] .travis.yml: add check-tcg test, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 31/54] tests/tcg: enable building for s390x, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 37/54] tests/tcg: enable building for sh4, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 53/54] tests/docker/Makefile.include: only force SID to NOCACHE if old, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 42/54] tests/tcg: enable building for PowerPC, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 48/54] tests: add top-level make dependency for docker builds,
Alex Bennée <=
- [Qemu-devel] [PATCH v7 20/54] tests/tcg/i386/test-i386: use modern vector_size attributes, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 47/54] tests/tcg: override runners for broken tests, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 41/54] docker: move debian-powerpc-cross to sid based build, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 25/54] tests/tcg: enable building for AArch64, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 49/54] docker: docker.py don't conflate checksums for extra_files, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 40/54] tests/tcg: enable building for RISCV64, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 18/54] tests/tcg/i386: add runner for test-i386-fprem, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 30/54] tests/tcg/mips: include common mips hello-mips, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 33/54] tests/tcg: enable building for Alpha, Alex Bennée, 2018/06/15
- [Qemu-devel] [PATCH v7 28/54] tests/tcg: enable building for MIPS, Alex Bennée, 2018/06/15