From nobody Thu Nov 6 10:20:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540904205152326.9153493579248; Tue, 30 Oct 2018 05:56:45 -0700 (PDT) Received: from localhost ([::1]:53072 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHTZc-0007Yl-4e for importer@patchew.org; Tue, 30 Oct 2018 08:56:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHTTi-0001Tt-U5 for qemu-devel@nongnu.org; Tue, 30 Oct 2018 08:50:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHTTh-0001l1-0Z for qemu-devel@nongnu.org; Tue, 30 Oct 2018 08:50:38 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:52126) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHTTf-0001A1-0F for qemu-devel@nongnu.org; Tue, 30 Oct 2018 08:50:36 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gHTTF-00013C-7f; Tue, 30 Oct 2018 12:50:09 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 12:50:03 +0000 Message-Id: <20181030125005.28151-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181030125005.28151-1-peter.maydell@linaro.org> References: <20181030125005.28151-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 1/3] configure: Rename FILES variable to LINKS 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: "Michael S. Tsirkin" , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" The FILES variable is used to accumulate a list of things to symlink from the source tree into the build tree. These don't have to be individual files; symlinking an entire directory of data files is also fine. Rename it to something less confusing before we add a few directories to it. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daud=C3=A9 Tested-by: Philippe Mathieu-Daud=C3=A9 --- configure | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/configure b/configure index 1c473ce95ba..b7d0167b650 100755 --- a/configure +++ b/configure @@ -7366,22 +7366,25 @@ if test "$ccache_cpp2" =3D "yes"; then echo "export CCACHE_CPP2=3Dy" >> $config_host_mak fi =20 -# build tree in object directory in case the source is not in the current = directory +# If we're using a separate build tree, set it up now. +# DIRS are directories which we simply mkdir in the build tree; +# LINKS are things to symlink back into the source tree +# (these can be both files and directories). DIRS=3D"tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/q= api-schema tests/tcg/xtensa tests/qemu-iotests tests/vm" DIRS=3D"$DIRS tests/fp" DIRS=3D"$DIRS docs docs/interop fsdev scsi" DIRS=3D"$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" DIRS=3D"$DIRS roms/seabios roms/vgabios" -FILES=3D"Makefile tests/tcg/Makefile qdict-test-data.txt" -FILES=3D"$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" -FILES=3D"$FILES tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makef= ile" -FILES=3D"$FILES tests/fp/Makefile" -FILES=3D"$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" -FILES=3D"$FILES pc-bios/spapr-rtas/Makefile" -FILES=3D"$FILES pc-bios/s390-ccw/Makefile" -FILES=3D"$FILES roms/seabios/Makefile roms/vgabios/Makefile" -FILES=3D"$FILES pc-bios/qemu-icon.bmp" -FILES=3D"$FILES .gdbinit scripts" # scripts needed by relative path in .gd= binit +LINKS=3D"Makefile tests/tcg/Makefile qdict-test-data.txt" +LINKS=3D"$LINKS tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" +LINKS=3D"$LINKS tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makef= ile" +LINKS=3D"$LINKS tests/fp/Makefile" +LINKS=3D"$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps" +LINKS=3D"$LINKS pc-bios/spapr-rtas/Makefile" +LINKS=3D"$LINKS pc-bios/s390-ccw/Makefile" +LINKS=3D"$LINKS roms/seabios/Makefile roms/vgabios/Makefile" +LINKS=3D"$LINKS pc-bios/qemu-icon.bmp" +LINKS=3D"$LINKS .gdbinit scripts" # scripts needed by relative path in .gd= binit for bios_file in \ $source_path/pc-bios/*.bin \ $source_path/pc-bios/*.lid \ @@ -7393,18 +7396,18 @@ for bios_file in \ $source_path/pc-bios/u-boot.* \ $source_path/pc-bios/palcode-* do - FILES=3D"$FILES pc-bios/$(basename $bios_file)" + LINKS=3D"$LINKS pc-bios/$(basename $bios_file)" done for test_file in $(find $source_path/tests/acpi-test-data -type f) do - FILES=3D"$FILES tests/acpi-test-data$(echo $test_file | sed -e 's/.*ac= pi-test-data//')" + LINKS=3D"$LINKS tests/acpi-test-data$(echo $test_file | sed -e 's/.*ac= pi-test-data//')" done for test_file in $(find $source_path/tests/hex-loader-check-data -type f) do - FILES=3D"$FILES tests/hex-loader-check-data$(echo $test_file | sed -e = 's/.*hex-loader-check-data//')" + LINKS=3D"$LINKS tests/hex-loader-check-data$(echo $test_file | sed -e = 's/.*hex-loader-check-data//')" done mkdir -p $DIRS -for f in $FILES ; do +for f in $LINKS ; do if [ -e "$source_path/$f" ] && [ "$pwd_is_source_path" !=3D "y" ]; then symlink "$source_path/$f" "$f" fi --=20 2.19.1 From nobody Thu Nov 6 10:20:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540904095399757.4291314216596; Tue, 30 Oct 2018 05:54:55 -0700 (PDT) Received: from localhost ([::1]:53057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHTXq-0006IR-CI for importer@patchew.org; Tue, 30 Oct 2018 08:54:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHTTb-0001NA-IU for qemu-devel@nongnu.org; Tue, 30 Oct 2018 08:50:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHTTL-0001F7-BG for qemu-devel@nongnu.org; Tue, 30 Oct 2018 08:50:19 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:52126) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHTTJ-0001A1-9z for qemu-devel@nongnu.org; Tue, 30 Oct 2018 08:50:15 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gHTTG-00013T-4S; Tue, 30 Oct 2018 12:50:10 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 12:50:04 +0000 Message-Id: <20181030125005.28151-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181030125005.28151-1-peter.maydell@linaro.org> References: <20181030125005.28151-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 2/3] configure: Symlink entire test directories rather than individual files 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: "Michael S. Tsirkin" , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Instead of symlinking every individual file inside the data directories used by some tests, just symlink the entire directory. This avoids a problem where if a new data file is added to the source tree, nothing results in configure being rerun to create the symlink, and so test runs in the build tree fail to find the file. Add a comment noting why adding wildcards to FILES is a bad idea. (Yes, we still do this for various files in pc-bios/; we get away with this because we don't in practice add new BIOS images often and if we do there's also usually a change that means configure is rerun anyway. We can't just symlink all of pc-bios into the build tree because it contains other things than just generated binaries.) Signed-off-by: Peter Maydell --- configure | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/configure b/configure index b7d0167b650..acb9a4d39e5 100755 --- a/configure +++ b/configure @@ -7370,6 +7370,12 @@ fi # DIRS are directories which we simply mkdir in the build tree; # LINKS are things to symlink back into the source tree # (these can be both files and directories). +# Caution: do not add files or directories here using wildcards. This +# will result in problems later if a new file matching the wildcard is +# added to the source tree -- nothing will cause configure to be rerun +# so the build tree will be missing the link back to the new file, and +# tests might fail. Prefer to keep the relevant files in their own +# directory and symlink the directory instead. DIRS=3D"tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/q= api-schema tests/tcg/xtensa tests/qemu-iotests tests/vm" DIRS=3D"$DIRS tests/fp" DIRS=3D"$DIRS docs docs/interop fsdev scsi" @@ -7385,6 +7391,7 @@ LINKS=3D"$LINKS pc-bios/s390-ccw/Makefile" LINKS=3D"$LINKS roms/seabios/Makefile roms/vgabios/Makefile" LINKS=3D"$LINKS pc-bios/qemu-icon.bmp" LINKS=3D"$LINKS .gdbinit scripts" # scripts needed by relative path in .gd= binit +LINKS=3D"$LINKS tests/acpi-test-data tests/hex-loader-check-data" for bios_file in \ $source_path/pc-bios/*.bin \ $source_path/pc-bios/*.lid \ @@ -7398,14 +7405,6 @@ for bios_file in \ do LINKS=3D"$LINKS pc-bios/$(basename $bios_file)" done -for test_file in $(find $source_path/tests/acpi-test-data -type f) -do - LINKS=3D"$LINKS tests/acpi-test-data$(echo $test_file | sed -e 's/.*ac= pi-test-data//')" -done -for test_file in $(find $source_path/tests/hex-loader-check-data -type f) -do - LINKS=3D"$LINKS tests/hex-loader-check-data$(echo $test_file | sed -e = 's/.*hex-loader-check-data//')" -done mkdir -p $DIRS for f in $LINKS ; do if [ -e "$source_path/$f" ] && [ "$pwd_is_source_path" !=3D "y" ]; then --=20 2.19.1 From nobody Thu Nov 6 10:20:09 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1540903939314328.5793023605812; Tue, 30 Oct 2018 05:52:19 -0700 (PDT) Received: from localhost ([::1]:53045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHTVK-0002Pd-9W for importer@patchew.org; Tue, 30 Oct 2018 08:52:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38019) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gHTTJ-00013B-FU for qemu-devel@nongnu.org; Tue, 30 Oct 2018 08:50:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gHTTI-0001CW-GP for qemu-devel@nongnu.org; Tue, 30 Oct 2018 08:50:13 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:52126) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gHTTI-0001A1-4T for qemu-devel@nongnu.org; Tue, 30 Oct 2018 08:50:12 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1gHTTH-00013j-30; Tue, 30 Oct 2018 12:50:11 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Tue, 30 Oct 2018 12:50:05 +0000 Message-Id: <20181030125005.28151-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181030125005.28151-1-peter.maydell@linaro.org> References: <20181030125005.28151-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH 3/3] configure: Use FILES loop for all build tree symlinks 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: "Michael S. Tsirkin" , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" A few places in configure were doing ad-hoc calls to the symlink function to set up symlinks from the build tree back to the source tree. We have a loop that does this already for all files and directories listed in the FILES environment variable; use that instead. Signed-off-by: Peter Maydell --- configure | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/configure b/configure index acb9a4d39e5..11ca69472a6 100755 --- a/configure +++ b/configure @@ -7392,6 +7392,8 @@ LINKS=3D"$LINKS roms/seabios/Makefile roms/vgabios/Ma= kefile" LINKS=3D"$LINKS pc-bios/qemu-icon.bmp" LINKS=3D"$LINKS .gdbinit scripts" # scripts needed by relative path in .gd= binit LINKS=3D"$LINKS tests/acpi-test-data tests/hex-loader-check-data" +LINKS=3D"$LINKS tests/acceptance tests/data" +LINKS=3D"$LINKS tests/qemu-iotests/check" for bios_file in \ $source_path/pc-bios/*.bin \ $source_path/pc-bios/*.lid \ @@ -7428,25 +7430,13 @@ for rom in seabios vgabios ; do echo "RANLIB=3D$ranlib" >> $config_mak done =20 -# set up tests data directory -for tests_subdir in acceptance data; do - if [ ! -e tests/$tests_subdir ]; then - symlink "$source_path/tests/$tests_subdir" tests/$tests_subdir - fi -done - # set up qemu-iotests in this build directory iotests_common_env=3D"tests/qemu-iotests/common.env" -iotests_check=3D"tests/qemu-iotests/check" =20 echo "# Automatically generated by configure - do not modify" > "$iotests_= common_env" echo >> "$iotests_common_env" echo "export PYTHON=3D'$python'" >> "$iotests_common_env" =20 -if [ ! -e "$iotests_check" ]; then - symlink "$source_path/$iotests_check" "$iotests_check" -fi - # Save the configure command line for later reuse. cat <config.status #!/bin/sh --=20 2.19.1