From patchwork Tue Jun 19 15:44:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 139200 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5397988lji; Tue, 19 Jun 2018 09:14:02 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL16gcBFAQdatwr1CRCE00W49KOM3xkcEipaar389mfQYmehxpkYkeicc4DfBfb9GL03Eu/ X-Received: by 2002:ae9:c008:: with SMTP id u8-v6mr14979886qkk.85.1529424842542; Tue, 19 Jun 2018 09:14:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529424842; cv=none; d=google.com; s=arc-20160816; b=b3VGANVIpSOfsLlzph/CocNlXU7fnaLgPgkIGAGZfsot1SL18qGIGllQLSQm200ZXj qQtcqWUjQ9VCQOzdCUJTIkaN27VtbtdvFaj61nBR5dMqJDN7IjBr8cSXK7CcTE+b5DNF 7E7qSD12yPtcATlmXbCpMknBR78iT+WTnm1GEMqcyZ7ep17QUwgBPyzh+p8lU2z/KFkT QUqplFoioKQFkipn1T/qiGyf4BtniQkNgJeuf0xyDpIwqhStTpx6cEzZnvOpLZcNxbUu zwiTplcmzMHiQO2q7wA2NYX4+u2MZbWBGIPB7ByfBCe6sK4wrTTaoOOayALeflBNEUiV mKnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=cL0F6K4Pm6zSiGW/ZhlmvqHwwS3kKdDmx2C4El+0ZSE=; b=Rn4EpYEssU+5ccxEN2Qc2gaT96I3W3qYuhzCXW2kdZ1c7W4l9kt/6guxYFoA6fNJGE EVuMRYY84Ay8qYvqnJYgDNaDQvXhlk626uOSzhbG3hmpNJ2YFjBrQNnGKDG9J5Gd5DBo dzR7CnzdirKw1rmLZ6mp98TmFvy6VLBG+Z6PkXqTnmrnKjolk2xLU3+ZW8uwVxs6y1a3 D5kIek6Xz09Xazjvv6G49JXFujRpGsRfehPpr0hzFOCXJQGnlIO+fowh+AYGsz2HB3fm AwGc0IJu2dpzhvkGgzl+Rl0KPxqTwOEw7rthYb71Mw/047xB9ZN9LWd7AJ5vOwBllnk+ 22ZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aWsS9nZ3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id a189-v6si66922qkc.229.2018.06.19.09.14.02 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 19 Jun 2018 09:14:02 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=aWsS9nZ3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:43516 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVJGb-0004o7-Up for patch@linaro.org; Tue, 19 Jun 2018 12:14:01 -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) 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-Received: by 2002:a1c:938e:: with SMTP id v136-v6mr11626006wmd.32.1529423518642; Tue, 19 Jun 2018 08:51:58 -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) From: =?utf-8?q?Alex_Benn=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 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_Benn=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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 --- v7 - remove $(info) spam - just add the explicit docker dependency to each build target - include build-tcg-prereqs for CI tasks -- 2.17.1 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