Skip to contentSkip to conversation

configure: warn if not using a separate build directory

PATCH Superseded Daniel P. Berrangé 4 participants 4 messages Mar 31, 2020

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 configure: warn if not using a separate build directory

Running configure directly from the source directory is a build configuration that will go away in future. It is also not currently covered by any automated testing. Display a deprecation warning if the user attempts to use an in-srcdir build setup, so that they are aware that they're building QEMU in an undesirable manner.

---

Changed in v3:
- Don't try to predict the future so much, just recommend a separate build dir

 configure | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
configure +26 -0
index e225a1e3ff..b4d1b01689 100755
@@ -285,6 +285,16 @@ then
   error_exit "main directory cannot contain spaces nor colons"
 fi
 
+canon_build_path=$(realpath -- "$PWD")
+canon_source_path=$(realpath -- "$source_path")
+
+in_srcdir=no
+if [ "$canon_build_path" = "$canon_source_path" ]
+then
+    in_srcdir=yes
+fi
+
+
 # default parameters
 cpu=""
 iasl="iasl"
@@ -6799,6 +6809,22 @@ if test "$supported_os" = "no"; then
     echo "us upstream at [email protected]."
 fi
 
+if test "$in_srcdir" = "yes"; then
+    echo
+    echo "WARNING: SUPPORT FOR IN SOURCE DIR BUILDS IS DEPRECATED"
+    echo
+    echo "Support for running the 'configure' script directly from the"
+    echo "source directory is deprecated. In source dir builds are not"
+    echo "covered by automated testing and thus may not correctly build"
+    echo "QEMU. Users are recommended to use a separate build directory:"
+    echo
+    echo "  $ mkdir build"
+    echo "  $ cd build"
+    echo "  $ ../configure"
+    echo "  $ make"
+    echo
+fi
+
 config_host_mak="config-host.mak"
 
 echo "# Automatically generated by configure - do not modify" >config-all-disas.mak
Signature · 1 line
2.24.1
Reviewed-by on v3 1/1
#1 lore raw
Quoted 10 lines · Daniel P. Berrangé

Running configure directly from the source directory is a build configuration that will go away in future. It is also not currently covered by any automated testing. Display a deprecation warning if the user attempts to use an in-srcdir build setup, so that they are aware that they're building QEMU in an undesirable manner.

---

configure if test "$supported_os" = "no"; then · line 6819

Quoted 8 lines
configure +8 -0
+if test "$in_srcdir" = "yes"; then
+    echo
+    echo "WARNING: SUPPORT FOR IN SOURCE DIR BUILDS IS DEPRECATED"
+    echo
+    echo "Support for running the 'configure' script directly from the"
+    echo "source directory is deprecated. In source dir builds are not"
+    echo "covered by automated testing and thus may not correctly build"
+    echo "QEMU. Users are recommended to use a separate build directory:"

Our mails crossed. I still think this reads a bit awkwardly; maybe:

s/IN SOURCE DIR BUILDS/BUILDING IN THE SOURCE DIR/ s/In source dir builds/In-tree builds/

Signature · 3 lines
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org
Reviewed-by
#2 lore raw
Quoted 20 lines · Eric Blake
Quoted 10 lines · Daniel P. Berrangé

Running configure directly from the source directory is a build configuration that will go away in future. It is also not currently covered by any automated testing. Display a deprecation warning if the user attempts to use an in-srcdir build setup, so that they are aware that they're building QEMU in an undesirable manner.

---

configure if test "$supported_os" = "no"; then · line 6819

Quoted 8 lines
configure +8 -0
+if test "$in_srcdir" = "yes"; then
+    echo
+    echo "WARNING: SUPPORT FOR IN SOURCE DIR BUILDS IS DEPRECATED"
+    echo
+    echo "Support for running the 'configure' script directly from the"
+    echo "source directory is deprecated. In source dir builds are not"
+    echo "covered by automated testing and thus may not correctly build"
+    echo "QEMU. Users are recommended to use a separate build directory:"
Quoted 6 lines

Our mails crossed. I still think this reads a bit awkwardly; maybe:

s/IN SOURCE DIR BUILDS/BUILDING IN THE SOURCE DIR/ s/In source dir builds/In-tree builds/

Preferably with Eric's tweaks:

Reviewed-by Tested-by
#3 lore raw
Quoted 24 lines · Markus Armbruster
Quoted 22 lines · Eric Blake
Quoted 10 lines · Daniel P. Berrangé

Running configure directly from the source directory is a build configuration that will go away in future. It is also not currently covered by any automated testing. Display a deprecation warning if the user attempts to use an in-srcdir build setup, so that they are aware that they're building QEMU in an undesirable manner.

---

configure if test "$supported_os" = "no"; then · line 6819

Quoted 8 lines
configure +8 -0
+if test "$in_srcdir" = "yes"; then
+    echo
+    echo "WARNING: SUPPORT FOR IN SOURCE DIR BUILDS IS DEPRECATED"
+    echo
+    echo "Support for running the 'configure' script directly from the"
+    echo "source directory is deprecated. In source dir builds are not"
+    echo "covered by automated testing and thus may not correctly build"
+    echo "QEMU. Users are recommended to use a separate build directory:"

Our mails crossed. I still think this reads a bit awkwardly; maybe:

Quoted 8 lines
Quoted 4 lines

s/IN SOURCE DIR BUILDS/BUILDING IN THE SOURCE DIR/ s/In source dir builds/In-tree builds/

Preferably with Eric's tweaks: