From patchwork Wed Jul 14 15:00:07 2021 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: 476783 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp668645jao; Wed, 14 Jul 2021 08:21:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFmamgnsPgwQ2Az2OYzBp5JNe8R7Ba6G+fS5EaPRrepd4YSc0VnOf4an6k8slEioWHQf7P X-Received: by 2002:a50:fe8d:: with SMTP id d13mr14335243edt.14.1626276088530; Wed, 14 Jul 2021 08:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626276088; cv=none; d=google.com; s=arc-20160816; b=FuHkuI6g9/V7FV4V2W66XBQkwpegppnqe9r+qh6lr/4S2FHSmwrJbbDifi/SxpEecy AI83DpVP6vy0ST4ohX+hDRcsah0fMvguN52blQ9fP2j5tEgQPKVBp9IyqrKFRC4Rxx1Z k4mfgYRiXvAuYLcSszfBnZhMcE0/tFz0Tz5DmRrq2xezlvnMv/CVewSqLI1Z+F16oc8z 3wR1w1GH0g/KQyikFtRPUj/HqBsP+8j8N2c1q1RLiDhVFOy8I2LPjDpWEuH+E6wchcQW sXB69Iakeh+QFpb24fkFLIkrU2NXY5wDocNyigKBKwwU3twGwGCG23wFnKbGvkQaem6w dA+Q== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=32upzgWYArkXqNRAuuHhbgidJ0G7HomnDnq8BKCaFQo=; b=Na7mNWMZhO3AyR4H8RYnS/yqAJm1fynu6nXO2PUFlQZpLtpzxQpVyomZeww+PvJnNr 9ySNqfJ3Eg41CMP8M24SR/N2oemu+rcd1I7diwCYstXgKV9TEFfgox9ZaA4yjU67Ecng 6vz0KZ2ME1sglaj/aG39THI+3b2QBTl653ce7NWkQPN3VWSRymNOM/NOuWHiUhP67u+B yffUD+/Zj8GM9tNcnpT3E0LySCiRGLonVO8C9jAASv5TqawvLybW8gYQ24woQzD3I7mJ I50x1ztBI5qP0WZya2u+x+yosW/pNXqcohPqhkihr/thX9DPlfkxlOx1NreUJIVitJ6s EswA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=do8ehKC3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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. [209.51.188.17]) by mx.google.com with ESMTPS id bh4si3573718ejb.358.2021.07.14.08.21.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Jul 2021 08:21:28 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=do8ehKC3; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 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]:55302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3ghT-0001W4-Ab for patch@linaro.org; Wed, 14 Jul 2021 11:21:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51626) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3gV3-0007Kq-6J for qemu-devel@nongnu.org; Wed, 14 Jul 2021 11:08:37 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:36859) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3gV0-00046e-W6 for qemu-devel@nongnu.org; Wed, 14 Jul 2021 11:08:36 -0400 Received: by mail-wm1-x32e.google.com with SMTP id l17-20020a05600c1d11b029021f84fcaf75so4137235wms.1 for ; Wed, 14 Jul 2021 08:08:34 -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=32upzgWYArkXqNRAuuHhbgidJ0G7HomnDnq8BKCaFQo=; b=do8ehKC3FL/ZDQxlJpVtzeQO+8HdgF4M/zTgsSSoQdNtijznqWQzXGI07Glo0x9WEO wnEpeKU+iR4Bzm7prByWWwgwf2G5aT9ZmCwos+Ho3Jx2mAzA46Q6iM42bgRG3RJ4TNku mtIieEQMYCpBLU9mc+jhgxaJ0vluIjDGz6Ota3Dz8QJ9Gbjw6GRYYKsmyIEw582NqzAL eYbz8rGxMdr4tLXnyPe5uF4aJdmjECwIGJajIe2JyVzJ5eAxtjfz1L/BWtNwVfcl1KtH hwTjR6PlAJsHJ0EALAtQxG9uKKSONQQonQqbTPao198Ljaq1GhrvCpoJyMHioJDcbkfE JjQw== 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=32upzgWYArkXqNRAuuHhbgidJ0G7HomnDnq8BKCaFQo=; b=T09NoLj6gvECG9fWHhVp7soE0489Lkq3h6l0LaSwizJuyWk0zH/Q9CNnDftvDd9nl9 039+QojeeKRns4UCUmTg1ILDQTvunr+chJmNp6+K0j9eEbI0PNIVhygZgm4HqTlXbPml IMFBYIMyp8VdAdjlDt7MlBbGWjQYK31tLkIMDxqG16pFiHxBZ+aEOjO/oDempFlYk2xI r+R7uw3WauztNopNwV086KQ9BsNOV0KZafumjDF1BDovCKc2tHAi0ITSPs0UxmyA/oxM Ubfhcgw8o0sZGivMSvW8UT115n/YHWjvR1CnbUlO/Khqg0htFQNv/4HGwZQEvfoHeHf8 9J3Q== X-Gm-Message-State: AOAM533M/aK4dlZAoxq/f8SEWELtHZMrr306wfYdK0RwA41uI6IdkK7Y HW0l0Gqim2B13AKZivOkSyeZlw== X-Received: by 2002:a05:600c:21c8:: with SMTP id x8mr4550416wmj.173.1626275313517; Wed, 14 Jul 2021 08:08:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q7sm2404457wmq.33.2021.07.14.08.08.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 08:08:25 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 82B5C1FF9E; Wed, 14 Jul 2021 16:00:38 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v5 15/44] tests/docker: remove FEATURES env var from templates Date: Wed, 14 Jul 2021 16:00:07 +0100 Message-Id: <20210714150036.21060-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210714150036.21060-1-alex.bennee@linaro.org> References: <20210714150036.21060-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Wainer dos Santos Moschetta , qemu-devel@nongnu.org, Willian Rampazzo , =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Daniel P. Berrangé In preparation for switching to auto-generated dockerfiles, remove the FEATURES env variable. The equivalent functionality can be achieved in most cases by just looking for existance of a binary. The cases which don't correspond to binaries are simply dropped because configure/meson will probe for any requested feature anyway. Signed-off-by: Daniel P. Berrangé Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Willian Rampazzo Reviewed-by: Alex Bennée Message-Id: <20210623142245.307776-6-berrange@redhat.com> Message-Id: <20210709143005.1554-14-alex.bennee@linaro.org> -- 2.20.1 diff --git a/tests/docker/common.rc b/tests/docker/common.rc index ebc5b97ecf..c5cc33d366 100755 --- a/tests/docker/common.rc +++ b/tests/docker/common.rc @@ -15,14 +15,23 @@ # overriden by TARGET_LIST if the user sets it. DEF_TARGET_LIST=${DEF_TARGET_LIST:-"x86_64-softmmu,aarch64-softmmu"} -requires() +requires_binary() { + found=0 for c in $@; do - if ! echo "$FEATURES" | grep -wq -e "$c"; then - echo "Prerequisite '$c' not present, skip" - exit 0 - fi + for d in /bin /usr/bin /usr/local/bin + do + if test -f "$d/$c" + then + found=1 + fi + done done + if test "$found" != "1" + then + echo "Prerequisite '$c' not present, skip" + exit 0 + fi } configure_qemu() diff --git a/tests/docker/dockerfiles/debian10.docker b/tests/docker/dockerfiles/debian10.docker index a27b88df55..b414af1b9f 100644 --- a/tests/docker/dockerfiles/debian10.docker +++ b/tests/docker/dockerfiles/debian10.docker @@ -35,5 +35,3 @@ RUN apt update && \ python3-sphinx \ python3-sphinx-rtd-theme \ $(apt-get -s build-dep --arch-only qemu | egrep ^Inst | fgrep '[all]' | cut -d\ -f2) - -ENV FEATURES docs diff --git a/tests/docker/dockerfiles/fedora-win32-cross.docker b/tests/docker/dockerfiles/fedora-win32-cross.docker index 9fed35f4e1..5a03e1af43 100644 --- a/tests/docker/dockerfiles/fedora-win32-cross.docker +++ b/tests/docker/dockerfiles/fedora-win32-cross.docker @@ -37,7 +37,6 @@ ENV PACKAGES \ RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt -ENV FEATURES mingw # Specify the cross prefix for this image (see tests/docker/common.rc) ENV QEMU_CONFIGURE_OPTS --cross-prefix=i686-w64-mingw32- diff --git a/tests/docker/dockerfiles/fedora-win64-cross.docker b/tests/docker/dockerfiles/fedora-win64-cross.docker index fb641f6104..ff706040c4 100644 --- a/tests/docker/dockerfiles/fedora-win64-cross.docker +++ b/tests/docker/dockerfiles/fedora-win64-cross.docker @@ -33,7 +33,6 @@ ENV PACKAGES \ RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt -ENV FEATURES mingw # Specify the cross prefix for this image (see tests/docker/common.rc) ENV QEMU_CONFIGURE_OPTS --cross-prefix=x86_64-w64-mingw32- --disable-capstone diff --git a/tests/docker/dockerfiles/fedora.docker b/tests/docker/dockerfiles/fedora.docker index a506e68d33..64a413f5e0 100644 --- a/tests/docker/dockerfiles/fedora.docker +++ b/tests/docker/dockerfiles/fedora.docker @@ -117,4 +117,3 @@ ENV QEMU_CONFIGURE_OPTS --python=/usr/bin/python3 RUN dnf install -y $PACKAGES RUN rpm -q $PACKAGES | sort > /packages.txt ENV PATH $PATH:/usr/libexec/python3-sphinx/ -ENV FEATURES mingw clang pyyaml asan docs diff --git a/tests/docker/dockerfiles/ubuntu.docker b/tests/docker/dockerfiles/ubuntu.docker index e0ff425c01..f0e0180d21 100644 --- a/tests/docker/dockerfiles/ubuntu.docker +++ b/tests/docker/dockerfiles/ubuntu.docker @@ -69,4 +69,3 @@ ENV PACKAGES \ RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES RUN dpkg -l $PACKAGES | sort > /packages.txt -ENV FEATURES clang pyyaml sdl2 docs diff --git a/tests/docker/dockerfiles/ubuntu1804.docker b/tests/docker/dockerfiles/ubuntu1804.docker index adcdef8244..0acdb0d9ad 100644 --- a/tests/docker/dockerfiles/ubuntu1804.docker +++ b/tests/docker/dockerfiles/ubuntu1804.docker @@ -55,7 +55,6 @@ ENV PACKAGES \ RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES RUN dpkg -l $PACKAGES | sort > /packages.txt -ENV FEATURES clang pyyaml sdl2 docs # https://bugs.launchpad.net/qemu/+bug/1838763 ENV QEMU_CONFIGURE_OPTS --disable-libssh diff --git a/tests/docker/dockerfiles/ubuntu2004.docker b/tests/docker/dockerfiles/ubuntu2004.docker index 78755bc2e3..88b3cfa136 100644 --- a/tests/docker/dockerfiles/ubuntu2004.docker +++ b/tests/docker/dockerfiles/ubuntu2004.docker @@ -70,7 +70,6 @@ ENV PACKAGES flex bison \ RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get -y install $PACKAGES RUN dpkg -l $PACKAGES | sort > /packages.txt -ENV FEATURES clang tsan pyyaml sdl2 # Apply patch https://reviews.llvm.org/D75820 # This is required for TSan in clang-10 to compile with QEMU. diff --git a/tests/docker/run b/tests/docker/run index 8edc7026ee..421393046b 100755 --- a/tests/docker/run +++ b/tests/docker/run @@ -30,9 +30,6 @@ mkdir -p $TEST_DIR/{src,build,install} # Extract the source tarballs tar -C $TEST_DIR/src -xf $BASE/qemu.tar || { echo "Failed to untar source"; exit 2; } -if test -f $TEST_DIR/src/Makefile; then - export FEATURES="$FEATURES dtc" -fi if test -n "$SHOW_ENV"; then if test -f /packages.txt; then diff --git a/tests/docker/test-clang b/tests/docker/test-clang index 8c51ead518..b57e0119d9 100755 --- a/tests/docker/test-clang +++ b/tests/docker/test-clang @@ -13,7 +13,7 @@ . common.rc -requires clang +requires_binary clang cd "$BUILD_DIR" diff --git a/tests/docker/test-debug b/tests/docker/test-debug index c050fa0d93..f52f16328c 100755 --- a/tests/docker/test-debug +++ b/tests/docker/test-debug @@ -14,7 +14,7 @@ . common.rc -requires clang asan +requires_binary clang cd "$BUILD_DIR" diff --git a/tests/docker/test-mingw b/tests/docker/test-mingw index c30eb654eb..0bc6d78872 100755 --- a/tests/docker/test-mingw +++ b/tests/docker/test-mingw @@ -13,7 +13,8 @@ . common.rc -requires mingw dtc +requires_binary x86_64-w64-mingw32-gcc +requires_binary i686-w64-mingw32-gcc cd "$BUILD_DIR" diff --git a/tests/docker/test-misc b/tests/docker/test-misc index cc94a738dd..2a3c2c2e1c 100755 --- a/tests/docker/test-misc +++ b/tests/docker/test-misc @@ -14,7 +14,7 @@ . common.rc -requires docs +requires_binary sphinx-build-3 sphinx-build cd "$BUILD_DIR" diff --git a/tests/docker/test-tsan b/tests/docker/test-tsan index eb40ac45b7..53d90d2f79 100755 --- a/tests/docker/test-tsan +++ b/tests/docker/test-tsan @@ -17,7 +17,7 @@ setup_tsan() { - requires clang tsan + requires_binary clang tsan_log_dir="/tmp/qemu-test/build/tsan" mkdir -p $tsan_log_dir > /dev/null || true EXTRA_CONFIGURE_OPTS="${EXTRA_CONFIGURE_OPTS} --enable-tsan \