tests/docker: remove FEATURES env var from templates
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 9 Jul 2021 14:29:38 +0000 (15:29 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Wed, 14 Jul 2021 13:33:53 +0000 (14:33 +0100)
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é <berrange@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20210623142245.307776-6-berrange@redhat.com>
Message-Id: <20210709143005.1554-14-alex.bennee@linaro.org>

14 files changed:
tests/docker/common.rc
tests/docker/dockerfiles/debian10.docker
tests/docker/dockerfiles/fedora-win32-cross.docker
tests/docker/dockerfiles/fedora-win64-cross.docker
tests/docker/dockerfiles/fedora.docker
tests/docker/dockerfiles/ubuntu.docker
tests/docker/dockerfiles/ubuntu1804.docker
tests/docker/dockerfiles/ubuntu2004.docker
tests/docker/run
tests/docker/test-clang
tests/docker/test-debug
tests/docker/test-mingw
tests/docker/test-misc
tests/docker/test-tsan

index ebc5b97ecf910f41b957f56bd3988217e8676d55..c5cc33d3662d98c663bf06536120d51307c62215 100755 (executable)
 # 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()
index a27b88df55ab80397c18ac452719837df5e28fef..b414af1b9f725fbd463235e2600e9726dfda0117 100644 (file)
@@ -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
index 9fed35f4e1de55f6cc16b423ca4d5a7844739dc5..5a03e1af43ac27a3ca6d7fc3175de7410c071487 100644 (file)
@@ -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-
index fb641f610419a05e282e71c0662d61617c06b926..ff706040c4c8a2d2d07947ef5a1387da4f371b50 100644 (file)
@@ -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
index a506e68d332b1aa2b0d8b97bd1440bfaa62df189..64a413f5e0198f732b8a77e4d8de86a2bab62746 100644 (file)
@@ -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
index e0ff425c0196f8229d6650642921f21b730b91d0..f0e0180d21585254aa94711218fb8d58fda7bb69 100644 (file)
@@ -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
index adcdef8244c26de975328a52e81031c6573410a7..0acdb0d9ad24d830475992944ed23ac70b6d810a 100644 (file)
@@ -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
index 78755bc2e3c103752042f18b33031a021edd62ae..88b3cfa13674e24f5367bc622ea57a7e6b24eaff 100644 (file)
@@ -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.
index 8edc7026ee3e1f88023757658f932cd156f2fe63..421393046b70ab0d186291d51863efa9dd1b079f 100755 (executable)
@@ -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
index 8c51ead5181b708dbd7d0f82486ec0780b9199ff..b57e0119d93f1a74bb09e874709cd98ddc88eba1 100755 (executable)
@@ -13,7 +13,7 @@
 
 . common.rc
 
-requires clang
+requires_binary clang
 
 cd "$BUILD_DIR"
 
index c050fa0d9382c11f2e9d29fcfafadf650c84c1fb..f52f16328ca72ce690e21497b54fbce5be383a8e 100755 (executable)
@@ -14,7 +14,7 @@
 
 . common.rc
 
-requires clang asan
+requires_binary clang
 
 cd "$BUILD_DIR"
 
index c30eb654eb7940f512bf848b208ecc20ff7e5b29..0bc6d788720008edabfe52344e79cdaa00fc9a26 100755 (executable)
@@ -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"
 
index cc94a738dd0a76e74be19dfe79b97f5fbe4cb644..2a3c2c2e1cf9245e3f3d34bc6c951fcb6f8ec0a3 100755 (executable)
@@ -14,7 +14,7 @@
 
 . common.rc
 
-requires docs
+requires_binary sphinx-build-3 sphinx-build
 
 cd "$BUILD_DIR"
 
index eb40ac45b7a44da2656ea506867d9e60892ff8a3..53d90d2f79fcc2ecf13de3e701f051887b0435f6 100755 (executable)
@@ -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 \