From patchwork Thu Jun 21 06:25:58 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: 139505 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1718419lji; Thu, 21 Jun 2018 00:23:25 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLmaqEQqTXQ72I0hD2owX2KhLs1Y8l3hf9td0tEh3iuGK5jivCtK/gb0Jaroifk7Y+cd6Qm X-Received: by 2002:a37:2b66:: with SMTP id r99-v6mr20855416qkh.286.1529565805004; Thu, 21 Jun 2018 00:23:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529565804; cv=none; d=google.com; s=arc-20160816; b=A22KIXyvipVLWnUTwiMlEMWBxeu+tm/eiZqVpHuce5GtB83AElnjCmts+TFzOgkI+M PwjXA6c+C5OOZKbKwwWlHpiTxTP6Qkip2+nJ1vkQYJe19fLijQN373zX8AvUeLv/rFqR olFgcqx3M6+L4t1pyQGAGVhiIdAD4baARsff1y9sfllqQWOZH7QH1F0ezqd2Q2PtjcdR ZuzNDBMud3A47eeQxk66vy8TWck9wi8KxgKBrjxcDvBYoVEU4RZvmeWrRJVMKgUHahte SUUULPnLx2Cj6aMA75fWCdZYj23CqzahyNRwq1m1IjJE1bMG3a5ENRT7tz5k5O+Hpm/M W1Hg== 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=ytjlsXnlMHutB8N/nLz79lN6OPcc8jQzs+mqsvoIBl4=; b=lvQZHWZrpoRFYKlwKIo0CBM+q2T1QMRvvLQIaZdUhXbxEMaEM4uRa6EG+YIUFb4kwP IIx1bTsS4OKGmOr/wQ0L6Bdei4w7aHDP60fCk+vdCLxfFhyubrptpy5cQdnnYoUYLo04 IA7aCUts1XpJcNCNeSaYV1ALII6KhLaOz1WHHna4jX1PoGQ1t5T8pCBiruSJctzUe3p3 kxr2xXNtJVpo2+b1R5UshQU8JU+ypzjMYZurdkRY0Hw56Ff7ILEIfITRsEcJwXyb+8Fb hU67xMnH/EFaXobv8sny7rS5cFj92cyZfD+FUUY0b7yTlFJDtVPmYQB72ohiwJ6k8XS5 lokw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=asnLtN6h; 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 h37-v6si3862545qvc.186.2018.06.21.00.23.24 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 21 Jun 2018 00:23:24 -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=asnLtN6h; 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]:53577 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVtwC-0003lp-Gq for patch@linaro.org; Thu, 21 Jun 2018 03:23:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56937) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fVtIH-00055n-1R for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:42:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fVtIF-0003TR-EY for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:42:09 -0400 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]:33341) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fVtIF-0003Sp-7e for qemu-devel@nongnu.org; Thu, 21 Jun 2018 02:42:07 -0400 Received: by mail-wm0-x242.google.com with SMTP id z6-v6so1926506wma.0 for ; Wed, 20 Jun 2018 23:42:07 -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=ytjlsXnlMHutB8N/nLz79lN6OPcc8jQzs+mqsvoIBl4=; b=asnLtN6hgvmJxjmIaWwAK2XIE2rRhDNOqm8kPmlDpPuURBlSp6eFH37nxw+AxRJ12s MGJPRVG4pqfsmHRPfKxAeZoDWuEi1IF+sF7EVkp1xhExsmEccAF0415fRiCbXHMs80Ud XAkulK9ioQ9KELog3W2LTNYjOVf8dlbjY9vKs= 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=ytjlsXnlMHutB8N/nLz79lN6OPcc8jQzs+mqsvoIBl4=; b=Q8Dt5gfhnMeOCYqLvWFfJyzKOONMXAtecGKA5j1F3l341nG/+RdeU95/jaJ7nZUovF IC9+BvIKUmxvr45q8mjy6ZfcMSbjrXSPYeX+Bql9RJyJT0Gb8leZkw9P84qZNh/iKZRi zHsRXdUKpF+DwI/dT1W+9Z+xA7hDKQUcPav1Ft7kg8gpHD0uLDwqq/5EKEVm5KfVKZsy 7/IU6T0o4xFYIU4NF/MKDsjeuaYQ4fhxA3b4W3fu46BV5Fwx3BcqjHfXgC6Wc62tCY/k VP3iBY92iC+NnZT1NvTNSMH7E7DgCX+ycHCt9BmydZc/XVG4ib3eosaR6eYpLd1QHUb1 F/3g== X-Gm-Message-State: APt69E20r/KoFWm0zCt+0viMsr3BIy3kYPVrA/aOfgQ7UKdEUFAqi1HM gQZ6X3Xm71/sP9dSTXPz6eKaUw== X-Received: by 2002:a1c:850c:: with SMTP id h12-v6mr3815434wmd.116.1529563326169; Wed, 20 Jun 2018 23:42:06 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m10-v6sm5648320wrq.56.2018.06.20.23.41.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 23:42:02 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 978CE3E1509; Thu, 21 Jun 2018 07:26:09 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Thu, 21 Jun 2018 07:25:58 +0100 Message-Id: <20180621062605.941-51-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180621062605.941-1-alex.bennee@linaro.org> References: <20180621062605.941-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] [PULL v2 50/57] 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 -- 2.17.1 diff --git a/tests/Makefile.include b/tests/Makefile.include index 5c401874e8..da647324a2 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)) +ifeq ($(HAVE_USER_DOCKER),y) +# Probe for the Docker Builds needed for each build +$(foreach PROBE_TARGET,$(TARGET_LIST), \ + $(eval -include $(SRC_PATH)/tests/tcg/Makefile.probe) \ + $(if $(DOCKER_PREREQ), \ + $(eval build-tcg-tests-$(PROBE_TARGET): $(DOCKER_PREREQ)))) +endif + build-tcg-tests-%: $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" guest-tests,) 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