From: Paolo Bonzini <pbonzini@redhat.com>
To: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [PATCH v2] configure: add --ninja option
Date: Thu, 27 Aug 2020 22:47:47 +0200 [thread overview]
Message-ID: <CABgObfZ2eeUQzyL5oRz_kejfqi6-AdSCWrmM3foZP3wwRhj3TA@mail.gmail.com> (raw)
In-Reply-To: <f04c27c7-84b1-c43c-6919-53fffcd5c360@ilande.co.uk>
[-- Attachment #1: Type: text/plain, Size: 4613 bytes --]
Thanks, that might be worth fixing in Meson.
Paolo
Il gio 27 ago 2020, 17:57 Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
ha scritto:
> On 26/08/2020 20:02, Paolo Bonzini wrote:
>
> > On Windows it is not possible to invoke a Python script as $NINJA.
> > If ninja is present use it directly, while if it is not we can
> > keep using ninjatool.
> >
> > Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> > Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> > ---
> > configure | 16 +++++++++++++++-
> > 1 file changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/configure b/configure
> > index 9db9bb89b9..6ecaff429b 100755
> > --- a/configure
> > +++ b/configure
> > @@ -568,6 +568,7 @@ rng_none="no"
> > secret_keyring=""
> > libdaxctl=""
> > meson=""
> > +ninja=""
> > skip_meson=no
> > gettext=""
> >
> > @@ -1052,6 +1053,8 @@ for opt do
> > ;;
> > --meson=*) meson="$optarg"
> > ;;
> > + --ninja=*) ninja="$optarg"
> > + ;;
> > --smbd=*) smbd="$optarg"
> > ;;
> > --extra-cflags=*)
> > @@ -1820,6 +1823,7 @@ Advanced options (experts only):
> > --python=PYTHON use specified python [$python]
> > --sphinx-build=SPHINX use specified sphinx-build [$sphinx_build]
> > --meson=MESON use specified meson [$meson]
> > + --ninja=NINJA use specified ninja [$ninja]
> > --smbd=SMBD use specified smbd [$smbd]
> > --with-git=GIT use specified git [$git]
> > --static enable static build [$static]
> > @@ -2058,6 +2062,16 @@ case "$meson" in
> > *) meson=$(command -v meson) ;;
> > esac
> >
> > +# Probe for ninja (used for compdb)
> > +
> > +if test -z "$ninja"; then
> > + for c in ninja ninja-build samu; do
> > + if has $c; then
> > + ninja=$(command -v "$c")
> > + break
> > + fi
> > + done
> > +fi
> >
> > # Check that the C compiler works. Doing this here before testing
> > # the host CPU ensures that we had a valid CC to autodetect the
> > @@ -8197,7 +8211,7 @@ fi
> > mv $cross config-meson.cross
> >
> > rm -rf meson-private meson-info meson-logs
> > -NINJA=$PWD/ninjatool $meson setup \
> > +NINJA=${ninja:-$PWD/ninjatool} $meson setup \
> > --prefix "${pre_prefix}$prefix" \
> > --libdir "${pre_prefix}$libdir" \
> > --libexecdir "${pre_prefix}$libexecdir" \
>
> I've just tested this, but it gives me a python stacktrace if I run it
> without
> passing a --ninja argument to configure. With a bit of extra debugging
> added to see
> what is being generated:
>
> ###XXX ['C:/msys64/mingw64/bin/ninja', '--version']
> Traceback (most recent call last):
> File "C:/msys64/home/Mark/qemu/meson/mesonbuild/mesonmain.py", line 131,
> in run
> return options.run_func(options)
> File "C:/msys64/home/Mark/qemu/meson/mesonbuild/msetup.py", line 245, in
> run
> app.generate()
> File "C:/msys64/home/Mark/qemu/meson/mesonbuild/msetup.py", line 159, in
> generate
> self._generate(env)
> File "C:/msys64/home/Mark/qemu/meson/mesonbuild/msetup.py", line 215, in
> _generate
> intr.backend.generate()
> File
> "C:/msys64/home/Mark/qemu/meson/mesonbuild/backend/ninjabackend.py", line
> 483,
> in generate
> ninja = environment.detect_ninja_command_and_version(log=True)
> File "C:/msys64/home/Mark/qemu/meson/mesonbuild/environment.py", line
> 177, in
> detect_ninja_command_and_version
> name = os.path.basename(n)
> File "C:/msys64/mingw64/lib/python3.8/ntpath.py", line 231, in basename
> return split(p)[1]
> File "C:/msys64/mingw64/lib/python3.8/ntpath.py", line 200, in split
> p = os.fspath(p)
> TypeError: expected str, bytes or os.PathLike object, not NoneType
>
> ERROR: meson setup failed
>
> It seems that it doesn't like parsing the discovered ninja path. I can
> make configure
> work by passing --ninja=ninja to configure which falls back to PATH and
> appears to do
> the right thing:
>
> ###XXX ['ninja', '--version']
> Found ninja.EXE-1.10.1 at C:\msys64\mingw64\bin/ninja.EXE
>
> I tried a few other things too:
>
> --ninja=C:/msys64/mingw64/bin/ninja - fails
> --ninja=C:/msys64/mingw64/bin/ninja.exe - works
> --ninja=ninja.exe - works
> --ninja=/c/msys64/mingw64/bin/ninja - fails similar as above
> --ninja=/c/msys64/mingw64/bin/ninja.exe - works
> --ninja=C:\\msys64\\mingw64\\bin\\ninja - fails similar as above
> --ninja=C:\\msys64\\mingw64\\bin\\ninja.exe - works
>
> From these tests it looks as if the .exe prefix is required when using a
> full path to
> the ninja executable.
>
>
> ATB,
>
> Mark.
>
>
[-- Attachment #2: Type: text/html, Size: 6082 bytes --]
prev parent reply other threads:[~2020-08-27 20:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 19:02 [PATCH v2] configure: add --ninja option Paolo Bonzini
2020-08-27 15:57 ` Mark Cave-Ayland
2020-08-27 20:47 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CABgObfZ2eeUQzyL5oRz_kejfqi6-AdSCWrmM3foZP3wwRhj3TA@mail.gmail.com \
--to=pbonzini@redhat.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).