From nobody Wed Feb 11 02:08:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529424794485913.7186779869307; Tue, 19 Jun 2018 09:13:14 -0700 (PDT) Received: from localhost ([::1]:43516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVJFp-0004o7-Nn for importer@patchew.org; Tue, 19 Jun 2018 12:13:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVIvW-0004Ix-Bd for qemu-devel@nongnu.org; Tue, 19 Jun 2018 11:52:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVIvI-0001sV-Ef for qemu-devel@nongnu.org; Tue, 19 Jun 2018 11:52:14 -0400 Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:53355) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVIvH-0001qj-Qc for qemu-devel@nongnu.org; Tue, 19 Jun 2018 11:52:00 -0400 Received: by mail-wm0-x241.google.com with SMTP id x6-v6so1202017wmc.3 for ; Tue, 19 Jun 2018 08:51:59 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d7-v6sm33445wrm.9.2018.06.19.08.51.50 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 19 Jun 2018 08:51:56 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id D4CC73E1058; Tue, 19 Jun 2018 16:44:39 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cL0F6K4Pm6zSiGW/ZhlmvqHwwS3kKdDmx2C4El+0ZSE=; b=aWsS9nZ3rb0W6UPqjTWx+DoEb1+mfWhEZeaTrVQJuRt3pnhl7zucBhUGlnOLVnBsua HfI51/WrA+IWkvYgNZAiidMZVNpq2qDEQECmkCdE6PKEfY6PthpDmLdeq6JItov3zP3b gq1MII7d6EFUCfvHNsM47/ogRSYX3FS7P7VX8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cL0F6K4Pm6zSiGW/ZhlmvqHwwS3kKdDmx2C4El+0ZSE=; b=jcvDx+EXh26m8EjWrAjJOulCxgPVbv5srQInPxFXMvbrJ4M3pNcfN3Ui9gqVnnJH+9 32f1ZRyRrI83syuTgRxaJjrx57n/G9FKMe+OtWqRhEUPMEh5addpHVnTrYSzuIzjb26K yH8Usj3Y9s9rSZ6n2+ZkS+N0XTJYN6UcA83zFRp8hvyavlsXHUfznrQczQ13V2cKwJAj 3vWJTr9mIY83tFypsTmES1HlCJX6sZj+yT81/Q6xJdb230HmY/u6APeE2fLRnaBi/jlz 57hDrQKwMwdO62O3ZIt9UhSdbwPapSpX8+ZxI31BW/1bwCWufqhZCDctaUdMkowOgCU5 uRJw== X-Gm-Message-State: APt69E3DwyMSgCdzc1dSmgaWC/ADN7qlUlNs+9K5NKrsBGrjeQHcFydl r0Z5vmWtu8b/oVuWnN2i7WETWw== X-Google-Smtp-Source: ADUXVKIzWx1dIl8kC95Me6SwTS59R9U9GYkxiuujWNt+zxarL8FagyXhWceJAqpMkO7u8EUexCjudQ== X-Received: by 2002:a1c:938e:: with SMTP id v136-v6mr11626006wmd.32.1529423518642; Tue, 19 Jun 2018 08:51:58 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Tue, 19 Jun 2018 16:44:28 +0100 Message-Id: <20180619154435.18898-50-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180619154435.18898-1-alex.bennee@linaro.org> References: <20180619154435.18898-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c09::241 Subject: [Qemu-devel] [PULL 49/56] tests: add top-level make dependency for docker builds X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: agraf@suse.de, =?UTF-8?q?Alex=20Benn=C3=A9e?= , richard.henderson@linaro.org, qemu-devel@nongnu.org, f4bug@amsat.org, cota@braap.org, famz@redhat.com, aurelien@aurel32.net Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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=C3=A9e --- v7 - remove $(info) spam - just add the explicit docker dependency to each build target - include build-tcg-prereqs for CI tasks 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=3D$(patsubst %,build-tcg-tests-= %, $(LINUX_USER_TARGETS)) CLEAN_TCG_TARGET_RULES=3D$(patsubst %,clean-tcg-tests-%, $(LINUX_USER_TARG= ETS)) RUN_TCG_TARGET_RULES=3D$(patsubst %,run-tcg-tests-%, $(LINUX_USER_TARGETS)) =20 +# Probe for the Docker Builds needed for each build +DOCKER_BUILD_TARGETS:=3D +$(foreach PROBE_TARGET,$(TARGET_LIST), \ + $(eval -include $(SRC_PATH)/tests/tcg/Makefile.probe) \ + $(if $(DOCKER_PREREQ), \ + $(eval DOCKER_BUILD_TARGETS+=3D$(DOCKER_PREREQ)) \ + $(eval build-tcg-tests-$(PROBE_TARGET): $(DOCKER_PREREQ)))) + build-tcg-tests-%: $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V=3D"$(V)" TARGET_= DIR=3D"$*/" guest-tests,) =20 @@ -947,6 +955,9 @@ run-tcg-tests-%: build-tcg-tests-% clean-tcg-tests-%: $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V=3D"$(V)" TARGET_= DIR=3D"$*/" clean-guest-tests,) =20 +.PHONY: build-tcg-prereqs +build-tcg-prereqs: $(DOCKER_BUILD_TARGETS) + .PHONY: build-tcg build-tcg: $(BUILD_TCG_TARGET_RULES) =20 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:=3D +DOCKER_IMAGE:=3D +DOCKER_PREREQ:=3D + +-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:=3Ddocker-image-$(DOCKER_IMAGE) +endif +endif + +# Clean-up +# undefine TARGET_NAME +# undefine TARGET_BASE_ARCH +# undefine TARGET_ABI_DIR --=20 2.17.1