From patchwork Tue Oct 30 12:50:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 149742 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5414450ljp; Tue, 30 Oct 2018 05:50:10 -0700 (PDT) X-Google-Smtp-Source: AJdET5dq0ex6TsBGBTSCwXxRU04+W0Ke6cXsSC/YTcpBbO33oPEhh7ZiV5S/i98eRi/4qgjCF8Pq X-Received: by 2002:a19:a086:: with SMTP id j128mr1685900lfe.93.1540903810450; Tue, 30 Oct 2018 05:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540903810; cv=none; d=google.com; s=arc-20160816; b=qw5cM5TGKvYXmRYXThQaeN30CtWoD4MMZUNOcA+i+Hw/6jD32hUPYLMG6EaVVxMX/D ztR6CBmSy3stu3ecUIOvYofk4b06VCBXSSXUgTYtzS1Gdy15+DH5H1EKMoiuxnpqGl6Y JtRMdnGTWV+9S13oCw66vfjapi9fo4Aodxn/8lworiLGtbeknbpYnA7ajEb+ModQ2YUJ VBbF7Ms7hwv6Ijfgix/r3bSu7vLrDEXQ+/e5uPwb8ppFh9MhJB7AZxi3EepR9LC1hhHt t5cNQyO+xB2AP1w8hEOTHXf0Pnq9btFWi6FZ0gZIEMPMi9antKPexifsWbEx2CrN9l0Q p9sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=rXRM+/Ve2hg2y5lt9TRwfFLBCGsZdvzWCR/4fPS3JzQ=; b=JxrEjwfQ9r/fSShOiHggt+mszEoFSQfUkFAkfIywSdUxyI5LlQ7KujObvHFGFDYM08 9wlkPM5mr04Jjr5CLFneKanO2tQRnUD9M8LyQ581Vc/Pob+KuGWNhED2/S2I1eVvF3HN DUTQ0cHSyf7pnWQgUzac9PNJGhFljIPRhJZYAPNP7ykpJKZOexjf9jK4k5sFxTzzwKFa TGn5hXtMpVo4Yt+//t/PblgYmOXjh/8bcp4VnHP+ne1qxsuqicQxXo/SSB3jnhvNul2J xzZueF1eKWEUBImNVxfRYBDL1HjCs6IUq1sn0uyR7KvC9Jl8ooNWtVPQvz+I2+jfk8fL 3b0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id f21-v6si4775050ljg.217.2018.10.30.05.50.09 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 05:50:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 Cc: patches@linaro.org, "Michael S. Tsirkin" Subject: [PATCH 1/3] configure: Rename FILES variable to LINKS 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 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 --- configure | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) -- 2.19.1 Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé diff --git a/configure b/configure index 1c473ce95ba..b7d0167b650 100755 --- a/configure +++ b/configure @@ -7366,22 +7366,25 @@ if test "$ccache_cpp2" = "yes"; then echo "export CCACHE_CPP2=y" >> $config_host_mak fi -# 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="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests tests/vm" DIRS="$DIRS tests/fp" DIRS="$DIRS docs docs/interop fsdev scsi" DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" DIRS="$DIRS roms/seabios roms/vgabios" -FILES="Makefile tests/tcg/Makefile qdict-test-data.txt" -FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" -FILES="$FILES tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makefile" -FILES="$FILES tests/fp/Makefile" -FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" -FILES="$FILES pc-bios/spapr-rtas/Makefile" -FILES="$FILES pc-bios/s390-ccw/Makefile" -FILES="$FILES roms/seabios/Makefile roms/vgabios/Makefile" -FILES="$FILES pc-bios/qemu-icon.bmp" -FILES="$FILES .gdbinit scripts" # scripts needed by relative path in .gdbinit +LINKS="Makefile tests/tcg/Makefile qdict-test-data.txt" +LINKS="$LINKS tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" +LINKS="$LINKS tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makefile" +LINKS="$LINKS tests/fp/Makefile" +LINKS="$LINKS pc-bios/optionrom/Makefile pc-bios/keymaps" +LINKS="$LINKS pc-bios/spapr-rtas/Makefile" +LINKS="$LINKS pc-bios/s390-ccw/Makefile" +LINKS="$LINKS roms/seabios/Makefile roms/vgabios/Makefile" +LINKS="$LINKS pc-bios/qemu-icon.bmp" +LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit 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="$FILES pc-bios/$(basename $bios_file)" + LINKS="$LINKS pc-bios/$(basename $bios_file)" done for test_file in $(find $source_path/tests/acpi-test-data -type f) do - FILES="$FILES tests/acpi-test-data$(echo $test_file | sed -e 's/.*acpi-test-data//')" + LINKS="$LINKS tests/acpi-test-data$(echo $test_file | sed -e 's/.*acpi-test-data//')" done for test_file in $(find $source_path/tests/hex-loader-check-data -type f) do - FILES="$FILES tests/hex-loader-check-data$(echo $test_file | sed -e 's/.*hex-loader-check-data//')" + LINKS="$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" != "y" ]; then symlink "$source_path/$f" "$f" fi From patchwork Tue Oct 30 12:50:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 149743 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5414454ljp; Tue, 30 Oct 2018 05:50:10 -0700 (PDT) X-Google-Smtp-Source: AJdET5fQVB/gYSuPVommxAvvewKlDdcyW1yF/4NhXsfMWsUs4Roxk/7ulsAsOgOsCdwK2ZqeRBbW X-Received: by 2002:adf:84a4:: with SMTP id 33-v6mr18135858wrg.191.1540903810674; Tue, 30 Oct 2018 05:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540903810; cv=none; d=google.com; s=arc-20160816; b=zvwTK1HsGVn1D5WTJKxcQzG55fbkq+JOv2RsXspiNb9PljLhx68zNGxwUzA+tsKLfn 3SqDtkhHjab2ZwtyHt1i8LDL3o35cQ3aBg5YyAFJmGQSaBLja3d5a+mHmUK12f8gP6d9 YQOSnBUgbmJlaKCsJAgR1o+owE3VZuBT9XHE1DcHYh56FBrUBQfPVryIiIkUQz6j03P1 DPnXe8a0txDZydxY2s0YpvyjifqfvT0vGkcrzbpvKl5bu7wIdyS8O1NzSJG42hIAbKoE m4IHvBwwFqyueXWyzs/531hjK5G4fLoyc2pK+KKjpFaoj5Z9zzdboZLlJwpifdi1vM0k Gmbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=muQhXmpJ81fgQ83cXB0oYB/478dg1Ld0WDPbVtKPRb4=; b=uDEGbRbiHOuq3axj3KaofMX9s5F7CB65BkwsBv/l11u5MWnEJMDxOxCLP5Zf21xsda jcpQryk2Fe77H1WfA9SqFeRB8MDAGxymhLrvtebxnSk1wcsMg9ZoolhbImOlJNpu1CwM BSLCdeCvNawBOxy3CzGRXT5CzEfzUzoLFDLikansJASHTx5XRCLuuRKOy6HTLyY9n/Or 78Nhs2gkjK2taXwNarI4UyrbNU4aREgA/7j71V8gdxNpZFmLG4Oi0SwmNKK3HFEfWFMz dgYPVZPbF2vqB8FHZsOyJjfWWbG5f/CmiRNROnRtqB67Gd8uZ+z+PQ475m0N2hifzHFg WhIg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id i138-v6si17549666wme.31.2018.10.30.05.50.10 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 05:50:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 Cc: patches@linaro.org, "Michael S. Tsirkin" Subject: [PATCH 2/3] configure: Symlink entire test directories rather than individual files 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 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(-) -- 2.19.1 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="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests tests/vm" DIRS="$DIRS tests/fp" DIRS="$DIRS docs docs/interop fsdev scsi" @@ -7385,6 +7391,7 @@ LINKS="$LINKS pc-bios/s390-ccw/Makefile" LINKS="$LINKS roms/seabios/Makefile roms/vgabios/Makefile" LINKS="$LINKS pc-bios/qemu-icon.bmp" LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit +LINKS="$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="$LINKS pc-bios/$(basename $bios_file)" done -for test_file in $(find $source_path/tests/acpi-test-data -type f) -do - LINKS="$LINKS tests/acpi-test-data$(echo $test_file | sed -e 's/.*acpi-test-data//')" -done -for test_file in $(find $source_path/tests/hex-loader-check-data -type f) -do - LINKS="$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" != "y" ]; then From patchwork Tue Oct 30 12:50:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 149744 Delivered-To: patches@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp5414476ljp; Tue, 30 Oct 2018 05:50:11 -0700 (PDT) X-Google-Smtp-Source: AJdET5fubyUy9/0vYoL7Xmdxdi+E3P4MZr/qtgjhhfMVaQ16fSocWHOkOF6YHTVILtzWpnmJz80L X-Received: by 2002:adf:80a3:: with SMTP id 32-v6mr19302194wrl.231.1540903811604; Tue, 30 Oct 2018 05:50:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540903811; cv=none; d=google.com; s=arc-20160816; b=ZSyiBvXS/ahbwknfFbC6+LA2t3Ws47y6lzGIvhsKgE7EV2HrZN6rlKGY7NYiy12i0h RGofxJuGMvO9G6g30AP8leZ2wUfKmUdeMOg7NUwVS8xvaQMtIyjnhTmV8mGe/wmZoHwp mcFdTS0rl04HZ3O/5TOeMReHYtDfSbeG+v/uGl5TZ/uSHGXWETKL0x0QLYc2TGv37wDS cbvnbUYCmn8PhFY1yuZMmM5fGYi4v5Y2Qg0nZvhu4nMfIoFG2Fiay0OmZLIlXbJqjpYN slPELCHzsyiEE/8pxGybWY1pfQEhH97a0EI/HIiDlP0Nm5JEyrLlv/inRqw8vDtgo04Y Kapg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=3d+8+7PZxcTvD8vXC1HshYs8NL4CijNNDK0DNGWQRQw=; b=Viz2jpS/Jc9VRMzKco8xQMqvaZ1PtqdKwicpv1bvNImSQ4z+caFHe+kPI2LQZYF34e BG70nj88PTqzaqvdZaJMWUHjUXS6gfZHI7yBkE1spAsk6sLu+eWmCxw2t9/FrBdA/YRx oViYUR+wQubdo/2qH6ACwtDWkuwJQk1yGP+BrMQ2fg5t3FMY2nlE0MJp6Lrj68gsxiAg IL22a+gxHSH2/mRCTizaYo+rqv33KCLjG7C60xC+uoPrOdzaq3xlAD4YQyZadUZcgpIk TO/1vSJ9LLb2rwvlRuzfpyWzjPVPDviCXpMaSbdsogcAqBmzF1gcc/umAkHwb4BeDj63 tvog== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by mx.google.com with ESMTPS id g11-v6si13393835wrr.181.2018.10.30.05.50.11 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 Oct 2018 05:50:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) client-ip=2001:8b0:1d0::2; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::2 as permitted sender) smtp.mailfrom=pm215@archaic.org.uk; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 Cc: patches@linaro.org, "Michael S. Tsirkin" Subject: [PATCH 3/3] configure: Use FILES loop for all build tree symlinks 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 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(-) -- 2.19.1 diff --git a/configure b/configure index acb9a4d39e5..11ca69472a6 100755 --- a/configure +++ b/configure @@ -7392,6 +7392,8 @@ LINKS="$LINKS roms/seabios/Makefile roms/vgabios/Makefile" LINKS="$LINKS pc-bios/qemu-icon.bmp" LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit LINKS="$LINKS tests/acpi-test-data tests/hex-loader-check-data" +LINKS="$LINKS tests/acceptance tests/data" +LINKS="$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=$ranlib" >> $config_mak done -# 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="tests/qemu-iotests/common.env" -iotests_check="tests/qemu-iotests/check" echo "# Automatically generated by configure - do not modify" > "$iotests_common_env" echo >> "$iotests_common_env" echo "export PYTHON='$python'" >> "$iotests_common_env" -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