mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.65k stars 1.64k forks source link

Ninja not found even when in path #7048

Open habersaa opened 4 years ago

habersaa commented 4 years ago

Describe the bug While trying to build gstream from the gst-build repository, at some point meson fails with the message "ERROR: Could not detect Ninja v1.5 or newer"

But Ninja is correctly in the path: PS C:\work\tests\gst-build> which ninja /c/Users/alexandre.haabersat/AppData/Roaming/Python/Python38/Scripts/ninja

PS C:\work\tests\gst-build> ninja --version 1.9.0.git.kitware.dyndep-1.jobserver-1

I have tried with 3 different versions of ninja, but the same problem appears all the time.

To Reproduce

  1. Clone gst-build from the github repository https://github.com/GStreamer/gst-build
  2. Navigate to the base of the repository (with a PowerShell contains MSVC compiler configuration).
  3. Type "meson build"
  4. All subproject are checked out correctly, but at the end it fails with a message saying that ninja is not found:

    
    All GStreamer modules 1.17.0.1
    
    Subprojects
                        FFmpeg: YES 3 warnings
                         dssim: NO C library 'm' not found
                    gl-headers: YES
                          glib: YES 3 warnings
                      graphene: YES
                  gst-devtools: YES
          gst-editing-services: YES
                  gst-examples: YES
    gst-integration-testsuites: YES
                     gst-libav: YES
                       gst-omx: NO Feature 'omx' disabled
               gst-plugins-bad: YES 3 warnings
              gst-plugins-base: YES 4 warnings
              gst-plugins-good: YES 5 warnings
                gst-plugins-rs: NO Feature 'rs' disabled
              gst-plugins-ugly: YES 1 warnings
                    gst-python: NO Could not find dependency pygobject_dep in subproject pygobject
               gst-rtsp-server: YES
                     gstreamer: YES 1 warnings
               gstreamer-sharp: NO Feature 'sharp' disabled
               gstreamer-vaapi: NO Feature 'vaapi' disabled
                         gtest: NO Subproject directory not found and gtest.wrap file not found
                     json-glib: YES 3 warnings
                        libffi: YES
                   libmicrodns: YES
                       libnice: NO Problem encountered: Either GnuTLS or OpenSSL is required as crypto library, but neither was found
                        libpsl: YES
                       libsoup: NO [WinError 2] The system cannot find the file specified
                       libxml2: YES
                      openh264: YES 8 warnings
                       openssl: NO Subproject directory not found and openssl.wrap file not found
                           orc: YES
                 proxy-libintl: YES
                     pygobject: NO Subproject directory not found and gobject-introspection.wrap file not found
                        sqlite: YES
                      tinyalsa: NO Subproject directory not found and tinyalsa.wrap file not found
       win-flex-bison-binaries: YES
                      win-nasm: YES
                          x264: YES
                          zlib: YES

ERROR: Could not detect Ninja v1.5 or newer


This is very frustrating as Ninja is correctly in the PATH, this error message is wrong and I see no way to overcome this error.

**Expected behavior**
4. Everything should be checked out and built by meson with no error.

**system parameters**
* Is this a [cross build](https://mesonbuild.com/Cross-compilation.html) or just a plain native build (for the same computer)?
Native Windows 10 build with MSVC19 64-bits.
* what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.)
Windows 10
* what Python version are you using e.g. 3.8.0
3.8.2-32, installed from the windows installer on the website
* what `meson --version`
0.54.1, installed with pip3
* what `ninja --version` if it's a Ninja build
1.9.0.git.kitware.dyndep-1.jobserver-1, installed with pip3
Also tried 1.10.0 from officiel repo binaries
Also tried 1.9.0 from Qt installation
Also tried from MSVC installation
(Only one Ninja is in the Windows path at a time.)
habersaa commented 4 years ago

After checking the python code of meson, I found a work-around for this issue by defining an environment variable called "NINJA" with the exact path, but neither the "ninja.exe" located in the Windows path, nor the one located beside meson.exe (when installed with Python) have been found.

dreamer-coding commented 4 years ago

Hello, @habersaa I think if you install Ninja with the pip package manager it would start working. Conceder reading through this page for more on that.