qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-for-6.0?] configure: Improve error message with specified meson path is not found
@ 2021-04-16 10:25 Philippe Mathieu-Daudé
  2021-04-16 11:09 ` Darren Kenny
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-04-16 10:25 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell, Philippe Mathieu-Daudé, Paolo Bonzini

When building on a system where meson isn't available,
but installed manually as user pip package, we get:

  $ ../configure --meson=~/.local/bin/meson
  qemu/configure: line 6387: --version: command not found
  You are attempting to run "setup" which requires administrative
  privileges, but more information is needed in order to do so.
  Authenticating as "root"
  Password:

Improve the error message to something less scary:

  $ ../configure --meson=~/.local/bin/meson
  ERROR: Meson not found.  Use --meson=/path/to/meson (absolute path)

Actually in this case the fix is to use $HOME, not unexpanded ~:

  $ ../configure --meson=$HOME/.local/bin/meson
  The Meson build system
  Version: 0.56.99
  ...

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 configure | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/configure b/configure
index 4f374b48890..088a82e3d86 100755
--- a/configure
+++ b/configure
@@ -1987,7 +1987,12 @@ case "$meson" in
     git | internal)
         meson="$python ${source_path}/meson/meson.py"
         ;;
-    *) meson=$(command -v "$meson") ;;
+    *)
+        meson=$(command -v "$meson")
+        if test -z "$meson"; then
+            error_exit "Meson not found.  Use --meson=/path/to/meson (absolute path)"
+        fi
+        ;;
 esac
 
 # Probe for ninja
-- 
2.26.3



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

* Re: [PATCH-for-6.0?] configure: Improve error message with specified meson path is not found
  2021-04-16 10:25 [PATCH-for-6.0?] configure: Improve error message with specified meson path is not found Philippe Mathieu-Daudé
@ 2021-04-16 11:09 ` Darren Kenny
  2021-04-16 11:14   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Darren Kenny @ 2021-04-16 11:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Peter Maydell, Philippe Mathieu-Daudé, Paolo Bonzini

On Friday, 2021-04-16 at 12:25:59 +02, Philippe Mathieu-Daudé wrote:
> When building on a system where meson isn't available,
> but installed manually as user pip package, we get:
>
>   $ ../configure --meson=~/.local/bin/meson
>   qemu/configure: line 6387: --version: command not found
>   You are attempting to run "setup" which requires administrative
>   privileges, but more information is needed in order to do so.
>   Authenticating as "root"
>   Password:
>
> Improve the error message to something less scary:
>
>   $ ../configure --meson=~/.local/bin/meson
>   ERROR: Meson not found.  Use --meson=/path/to/meson (absolute path)
>
> Actually in this case the fix is to use $HOME, not unexpanded ~:
>
>   $ ../configure --meson=$HOME/.local/bin/meson
>   The Meson build system
>   Version: 0.56.99
>   ...
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Reviewed-by: Darren Kenny <darren.kenny@oracle.com>

Interesting that some shells don't expand the tilde (~), when some will
in this case - but either way this message is a lot clearer.

Thanks,

Darren.

> ---
>  configure | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 4f374b48890..088a82e3d86 100755
> --- a/configure
> +++ b/configure
> @@ -1987,7 +1987,12 @@ case "$meson" in
>      git | internal)
>          meson="$python ${source_path}/meson/meson.py"
>          ;;
> -    *) meson=$(command -v "$meson") ;;
> +    *)
> +        meson=$(command -v "$meson")
> +        if test -z "$meson"; then
> +            error_exit "Meson not found.  Use --meson=/path/to/meson (absolute path)"
> +        fi
> +        ;;
>  esac
>  
>  # Probe for ninja
> -- 
> 2.26.3


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

* Re: [PATCH-for-6.0?] configure: Improve error message with specified meson path is not found
  2021-04-16 11:09 ` Darren Kenny
@ 2021-04-16 11:14   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2021-04-16 11:14 UTC (permalink / raw)
  To: Darren Kenny; +Cc: Paolo Bonzini, Philippe Mathieu-Daudé, QEMU Developers

On Fri, 16 Apr 2021 at 12:09, Darren Kenny <darren.kenny@oracle.com> wrote:
>
> On Friday, 2021-04-16 at 12:25:59 +02, Philippe Mathieu-Daudé wrote:
> >   $ ../configure --meson=~/.local/bin/meson
> >   ERROR: Meson not found.  Use --meson=/path/to/meson (absolute path)

> Interesting that some shells don't expand the tilde (~), when some will
> in this case - but either way this message is a lot clearer.

What shells do expand ~ in the middle of a word? POSIX compliant
shells should not, I think...

thanks
-- PMM


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

end of thread, other threads:[~2021-04-16 11:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-16 10:25 [PATCH-for-6.0?] configure: Improve error message with specified meson path is not found Philippe Mathieu-Daudé
2021-04-16 11:09 ` Darren Kenny
2021-04-16 11:14   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).