From patchwork Fri Jun 8 12:33:05 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: 138049 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp909696lji; Fri, 8 Jun 2018 07:01:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKEvvrcEoBV7kwKOg1ugQPyrZvBPvvr8XtROL3lMrTAD+/8Ws0nAk5+pnvLzh7GGuh9CPTE X-Received: by 2002:ac8:94:: with SMTP id c20-v6mr5867501qtg.249.1528466474656; Fri, 08 Jun 2018 07:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528466474; cv=none; d=google.com; s=arc-20160816; b=LDEL3eZ5wwZ8ZAxYrmNRnzbPrxEjAYKvfaum8XtB97hN8pEGqFykZkMvxlHgeAOAr+ AbGXLrChgEYaGKzQvtKrwi661tU/95Lc7tmBBYF4+Vb2q3LFhVymirmVlODLdm1t19BJ K/qqMDTXo/z+WRAlFf6T7XDFM1ZgVps57eEbb65qzvQeX6AN05ymh9/QJDgxjv5pTMjk UEhJsstf/9xsbAL2GfvGZ4Wbnn+iBTbxoncQ24t74ePakMZdOd/gkZJdp6RGG6P9A2Zn kURnf9YpG0Q22c0WWqzf2JZpDivWvZru3TCLuQ8MWbM/W2kzSmhJBfHnVV0aQFivc0gr A2lw== 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=l+ddhA4XsiIQf62A8To+SUgJkDUdgo09yLx0mekcc5g=; b=TAQzp+/4uoHi9TXcL/jaFLAt8GIPNUEKvK3I6UnFKXkeuB8+NlQsSPmg7FSwsvIA30 YNKbsMAUgwM91wW0bvsMLukRab7rSQMpOM5W9Ihdglazguuw/8h53ulq1Pzk8GgCbK44 /FnkxfadiOr8E80yU05I+jOEaQqoQsKAwslTqS9/2W7ynIIsguJSJ+FJaeWwGlNJpJdS lbVr8bI6mpcTu9hmqCh2EZ1X5qiqs2kEadKd/p4i3uJKAyvjN4hf0LRe0/hobSX1/8WT CpxrGXUSll6hXMhW2+WLdL0OajixI/3qRC7bIRRjlhVwnpzh/AOni881qNzb2yVfXWuX QqMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eCc5Ib5Y; 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 a14-v6si6761300qvj.236.2018.06.08.07.01.14 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 08 Jun 2018 07:01:14 -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=eCc5Ib5Y; 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]:35857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRHx4-0006Hg-2D for patch@linaro.org; Fri, 08 Jun 2018 10:01:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fRGpO-0005uc-Kh for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:49:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fRGpM-0006dY-7q for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:49:14 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:35322) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fRGpM-0006d4-0B for qemu-devel@nongnu.org; Fri, 08 Jun 2018 08:49:12 -0400 Received: by mail-wm0-x242.google.com with SMTP id j15-v6so3542338wme.0 for ; Fri, 08 Jun 2018 05:49:11 -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=l+ddhA4XsiIQf62A8To+SUgJkDUdgo09yLx0mekcc5g=; b=eCc5Ib5YA06Lr+yr2q5uCkU7gcOfjm5pFZ31cW8KSzRoOLZgTfx70+7Tb+Lo6bhEi5 lhFRmKs+nsQ+2V4PXFXy9fr/XRAHcJciZhAhcVtf9uvOYUo8jNL3+1vH3MVesgAg0rxP ZK08LTQtGIxKDDfTteNhMFykmAnDEccM7t27w= 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=l+ddhA4XsiIQf62A8To+SUgJkDUdgo09yLx0mekcc5g=; b=VG9IxKxBuyoGixzjWzqdZKgpoeQNEkikJm3aOQ4qDkSW3G+kpaV3ZRdLi7rezq7RFY bZWbS9UEW2TXlx+A8tYb29USpu1JgavvEeHPAV8dWiEspMN4X53blqPMYTnTWUmrufdL O0QosZyBS23gtOM4MnspH+Q3doKkFezNbvhH5qffJTiK7YyauF0bsDcpl0kaBDgvfKy5 EFtHqyZmR7iYKeEVsAER9bHHYGXIQg54vLikZ9rhSOo2FWCme3383q58COMVUfR+Qkmn LaohDPJPNCqbWllMU0qtDLY6OAJiHs0/fOqboZKsu1QLoV11dXT9xLp2wbKNpnHKN/DL pO3w== X-Gm-Message-State: APt69E2JuK8lhkYJZHeHYAgqjfNecocql4HYf/vRefwEKLSK9rRYtyN9 tADwYIfO1nlFPwpEpv+6jP+LeA== X-Received: by 2002:a1c:3f56:: with SMTP id m83-v6mr1630346wma.88.1528462150862; Fri, 08 Jun 2018 05:49:10 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n7-v6sm27152699wrr.39.2018.06.08.05.49.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Jun 2018 05:49:08 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 3E2FB3E0DE6; Fri, 8 Jun 2018 13:33:11 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de, pbonzini@redhat.com, stefanha@redhat.com, stefanb@linux.vnet.ibm.com, marcandre.lureau@redhat.com Date: Fri, 8 Jun 2018 13:33:05 +0100 Message-Id: <20180608123307.24773-48-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180608123307.24773-1-alex.bennee@linaro.org> References: <20180608123307.24773-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::242 Subject: [Qemu-devel] [PATCH v6 47/49] 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org 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 --- tests/Makefile.include | 14 +++++++++++++- tests/tcg/Makefile.probe | 31 +++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/Makefile.probe -- 2.17.1 diff --git a/tests/Makefile.include b/tests/Makefile.include index ca00247e36..049a387436 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -931,7 +931,19 @@ 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)) -build-tcg-tests-%: +# Probe for the Docker Builds we need for later +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)))) + +$(info DOCKER_BUILD_TARGETS=$(sort $(DOCKER_BUILD_TARGETS))) + +.PHONY: build-docker-prereqs +build-docker-prereqs: $(sort $(DOCKER_BUILD_TARGETS)) + +build-tcg-tests-%: build-docker-prereqs $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" guest-tests,) run-tcg-tests-%: build-tcg-tests-% diff --git a/tests/tcg/Makefile.probe b/tests/tcg/Makefile.probe new file mode 100644 index 0000000000..7529e203ad --- /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 +undefine CROSS_CC_GUEST +undefine 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