All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] configure: Add 'mkdir build' check
@ 2023-02-21 11:06 Dinah Baum
  2023-02-21 11:14 ` Thomas Huth
  0 siblings, 1 reply; 3+ messages in thread
From: Dinah Baum @ 2023-02-21 11:06 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, Dinah Baum, Peter Maydell, Paolo Bonzini,
	Alex Bennée, Thomas Huth

QEMU configure script goes into an infinite error printing loop
when in read only directory due to 'build' dir never being created.

Checking if 'mkdir dir' succeeds prevents this error.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/321
Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 configure | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index cf6db3d551..1ef3e7f77d 100755
--- a/configure
+++ b/configure
@@ -31,7 +31,12 @@ then
         fi
     fi
 
-    mkdir build
+    if ! mkdir build || ! touch $MARKER
+    then
+        echo "ERROR: Could not create ./build directory. Check the permissions on"
+        echo "your source directory, or try doing an out-of-tree build."
+        exit 1
+    fi
     touch $MARKER
 
     cat > GNUmakefile <<'EOF'
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] configure: Add 'mkdir build' check
  2023-02-21 11:06 [PATCH v4] configure: Add 'mkdir build' check Dinah Baum
@ 2023-02-21 11:14 ` Thomas Huth
  2023-02-21 11:42   ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2023-02-21 11:14 UTC (permalink / raw)
  To: Dinah Baum, qemu-devel
  Cc: qemu-trivial, Peter Maydell, Paolo Bonzini, Alex Bennée

On 21/02/2023 12.06, Dinah Baum wrote:
> QEMU configure script goes into an infinite error printing loop
> when in read only directory due to 'build' dir never being created.
> 
> Checking if 'mkdir dir' succeeds prevents this error.
> 
> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/321
> Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   configure | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/configure b/configure
> index cf6db3d551..1ef3e7f77d 100755
> --- a/configure
> +++ b/configure
> @@ -31,7 +31,12 @@ then
>           fi
>       fi
>   
> -    mkdir build
> +    if ! mkdir build || ! touch $MARKER
> +    then
> +        echo "ERROR: Could not create ./build directory. Check the permissions on"
> +        echo "your source directory, or try doing an out-of-tree build."
> +        exit 1
> +    fi
>       touch $MARKER

Nit: I think the final "touch $MARKER" could now be removed, too, since the 
code either exits above, or runs the "|| ! touch $MARKER" part there already.

Anyway, it's just a nit, and maybe could also be fixed while picking up the 
patch, thus:

Reviewed-by: Thomas Huth <thuth@redhat.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v4] configure: Add 'mkdir build' check
  2023-02-21 11:14 ` Thomas Huth
@ 2023-02-21 11:42   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-02-21 11:42 UTC (permalink / raw)
  To: Thomas Huth, Dinah Baum, qemu-devel
  Cc: qemu-trivial, Peter Maydell, Paolo Bonzini, Alex Bennée

On 21/2/23 12:14, Thomas Huth wrote:
> On 21/02/2023 12.06, Dinah Baum wrote:
>> QEMU configure script goes into an infinite error printing loop
>> when in read only directory due to 'build' dir never being created.
>>
>> Checking if 'mkdir dir' succeeds prevents this error.
>>
>> Resolves: https://gitlab.com/qemu-project/qemu/-/issues/321
>> Signed-off-by: Dinah Baum <dinahbaum123@gmail.com>
>> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>>   configure | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/configure b/configure
>> index cf6db3d551..1ef3e7f77d 100755
>> --- a/configure
>> +++ b/configure
>> @@ -31,7 +31,12 @@ then
>>           fi
>>       fi
>> -    mkdir build
>> +    if ! mkdir build || ! touch $MARKER
>> +    then
>> +        echo "ERROR: Could not create ./build directory. Check the 
>> permissions on"
>> +        echo "your source directory, or try doing an out-of-tree build."
>> +        exit 1
>> +    fi
>>       touch $MARKER
> 
> Nit: I think the final "touch $MARKER" could now be removed, too, since 
> the code either exits above, or runs the "|| ! touch $MARKER" part there 
> already.
> 
> Anyway, it's just a nit, and maybe could also be fixed while picking up 
> the patch,

Yes please :)

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

> thus:
> 
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> 
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-21 11:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-21 11:06 [PATCH v4] configure: Add 'mkdir build' check Dinah Baum
2023-02-21 11:14 ` Thomas Huth
2023-02-21 11:42   ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.