From patchwork Fri Jun 15 19:46:59 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: 138788 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp1272304lji; Fri, 15 Jun 2018 13:14:35 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLyGw/Qf0XU3+C76MJCND7XmAkoJ89UTZKLQfWGESIolQfJeplTU9q5wTGj/hp3yXCie0VA X-Received: by 2002:a0c:946a:: with SMTP id i39-v6mr2771557qvi.139.1529093675462; Fri, 15 Jun 2018 13:14:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529093675; cv=none; d=google.com; s=arc-20160816; b=jmFN8lnw8LjymBbNPDaGYv9+S8UT2TxvTg7yQCXTIOTGl3jLfeLiS/mSL3m9oHSGDv vaIla8wdufoOYUV/WNX69zNmoTUaKPkV5lsict6LujsQL6qdyJGF4S4BsLEYUwRCneVx I/C+XRC/8I3pP9DolhTzK9tEzTp77eOZz7vCdCyVFXWY2cysrMHGniAFm5FpYXETTE/c dCoHaSnBup+4G/esldaS8hhMFjWrt0ECuMrlH9L0epL4j2/DoCFja1m0H2TQ1739XCTS SD5zdHpymvhfdZR6W6AKXf5L9OpgjNFBA0R9DboQH+Ej0ciG9AVMI6Z90mGGozd+2fno ALxA== 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=R/rl6LLJRyEaywud8SGoD43LnTeMCqAVwmDb1EmHi64=; b=e2pNSlwUo0gD1QsKMGa5aCU54MgLlSdmEXMF89Z0yyXFEuluGuc+2KLANoa2Ae78sL i15RqoJbldXzCvpAoYLbp+fd33jTAr3R2CtxH3EUUG2/cS32UySkPLAJ0g7yh+w3msUL eUOIi+t7zQGlKZMrbhrf+6IC8+03rqDX6g2wIC17+G1lPnhBLtRMqDakMDicC7QkknRM u7U6pt3xWtp5Thg0mEAN6O4c2NacK3Tddwa5IoDtyHx8S0peqfMA7o9MuZEiMHVtfk9g c8SxG2WXavlHnHn9sBt00CBFy3lKY7msk7eddrXobuc3xu8iKgJA/bwXKfOow54FOXw+ cjYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="BCqsM/Ga"; 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 a1-v6si8211182qtk.11.2018.06.15.13.14.35 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 15 Jun 2018 13:14:35 -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="BCqsM/Ga"; 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]:49121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTv7C-0007r1-Rc for patch@linaro.org; Fri, 15 Jun 2018 16:14:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53972) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fTuoY-0000Ya-RZ for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:55:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fTuoX-0006ZU-DZ for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:55:18 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:40390) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fTuoX-0006XY-2e for qemu-devel@nongnu.org; Fri, 15 Jun 2018 15:55:17 -0400 Received: by mail-wr0-x243.google.com with SMTP id l41-v6so10978394wre.7 for ; Fri, 15 Jun 2018 12:55:16 -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=R/rl6LLJRyEaywud8SGoD43LnTeMCqAVwmDb1EmHi64=; b=BCqsM/GaHAgTgfuZCNXZm1AN2m9r0druZaLvGl3lNbK/C5GnoiSwi32m7+cgjiS9i3 aznQ6iwAVZT+375Gdy8hhuvrCypK+uBD8qiRi24ZcW9lKeY3ech7Yb5pCRROCViQiJbj vHTp5EPOa0Mx4FqIWypFAhQ+nhek90WDiYA2o= 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=R/rl6LLJRyEaywud8SGoD43LnTeMCqAVwmDb1EmHi64=; b=TjUiMZPr1qjPjp5Ukh5jrcxjaiL0niiP1z/8E8RUyR896jZ0woDYpW7ZSxf+QPylBw sJVspjNRHrs9n71o5g5CGSPADhhK2k6rST5Ds0F8Fd9aAVMyXHDMwjnFtHz9x2++HtQ/ wWMPa94mCtOV3wTFoeIBbB6TPGORH6IRp8b1uobXifXS07EMBCkabO2d1KeFU/uSMcpm BcDfecLIq/u6a96cpTbU3NEFtvHU6oAxMgTjUfFhwm64GdP2pjxbGndYBPWjpScwkr7o BkWxGBbAevWuyFBlr0TrJ5UHpvDaZZOCojKeMSJqas+L/X+4a51JwDbaue4DpfUzHB6a u2Tg== X-Gm-Message-State: APt69E322n1FRLYzGqZSQLo8kprn4ErDywXk8JHuxl60MusNngi2KuxY PjiMBsHA6Kg/mYoRNE2oJafEIg== X-Received: by 2002:adf:d204:: with SMTP id g4-v6mr2755049wri.229.1529092515849; Fri, 15 Jun 2018 12:55:15 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id r5-v6sm6463409wrp.59.2018.06.15.12.55.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 15 Jun 2018 12:55:13 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id A02353E0FEB; Fri, 15 Jun 2018 20:47:09 +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, peter.maydell@linaro.org Date: Fri, 15 Jun 2018 20:46:59 +0100 Message-Id: <20180615194705.28019-49-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180615194705.28019-1-alex.bennee@linaro.org> References: <20180615194705.28019-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:c0c::243 Subject: [Qemu-devel] [PATCH v7 48/54] 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 --- 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 -- 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