Scrcpy: meson : command not found

Created on 31 Mar 2018  Â·  37Comments  Â·  Source: Genymobile/scrcpy

ADMIN@Adeidrick-EXT MINGW32 ~
$ meson x --buildtype release --strip -Db_lto=true
bash: meson: command not found

build windows

All 37 comments

Did you install the packages as explained?

yes

i see the installed packages in the folder C:\msys32\mingw32\bin

Do you run mingw32.exe (not msys2.exe)?

yes
ADMIN@Adeidrick-EXT MINGW32 ~
$ meson x --buildtype release --strip -Db_lto=true
bash: meson: command not found

Got the same problem but for 64-bit, tried with both msys2.exe and mingw64.exe (after reading this). It was a fresh installation too, just for this.

What is the result of:

pacman -S mingw-w64-x86_64-meson

or:

pacman -S mingw-w64-i686-meson

?

And:

echo $PATH

```Jumper@Jumper-PC MSYS ~
$ pacman -S mingw-w64-x86_64-meson
warning: mingw-w64-x86_64-meson-0.35.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) mingw-w64-x86_64-meson-0.35.1-1

Total Installed Size: 1.42 MiB
Net Upgrade Size: 0.00 MiB

:: Proceed with installation? [Y/n]
path from msys2.exe /usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl and mingw64.exe /mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl```
(wasn't sure which I'm actually supposed to build from)

FIRST

ADMIN@Adeidrick-EXT MINGW32 ~
$ pacman -S mingw-w64-x86_64-meson
warning: mingw-w64-x86_64-meson-0.35.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) mingw-w64-x86_64-meson-0.35.1-1

Total Installed Size:  1.42 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] n

SECOND

ADMIN@Adeidrick-EXT MINGW32 ~
$ pacman -S mingw-w64-i686-meson
warning: mingw-w64-i686-meson-0.35.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) mingw-w64-i686-meson-0.35.1-1

Total Installed Size:  1.42 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] n

THIRD

ADMIN@Adeidrick-EXT MINGW32 ~
$ echo $PATH
/mingw32/bin:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/

@doublejumper @Kaiju-A Your PATH variables seems to be correct, meson should be in /mingw64/bin (or /mingw32/bin):

$ which meson
/mingw64/bin/meson

That's weird.

ADMIN@Adeidrick-EXT MINGW32 ~
$ /mingw32/bin
bash: /mingw32/bin: Is a directory

yup

@Kaiju-A

ls -l /mingw32/bin/meson

$ ls -l /mingw32/bin/meson
ls: cannot access '/mingw32/bin/meson': No such file or directory

OK, that's the problem. So where is the binary meson installed from your package?

find / -name meson

(brute force)

$ find / -name meson
/mingw32/share/licenses/meson
/mingw64/share/licenses/meson
find: failed to read file names from file system at or below ‘/’: No such file or directory

what should i do ? is it possible to build on a different pc"B", then use on pc "A"?

@Kaiju-A You want to build it by yourself on windows because you need a 32 bits version, or you want a version more recent than the last release?

ADMIN@Adeidrick-EXT MINGW32 ~
$ mkdir x
mkdir: cannot create directory ‘x’: File exists

ADMIN@Adeidrick-EXT MINGW32 ~
$ meson x --buildtype release --strip -Db_lto=true
bash: meson: command not found

tried this, didnt work

Got the same results. And I just want a more recent version.

HI - I recently set up a build to make a pull request. On my windows machine, I had to add the ".py" file extension when running meson. Eg:

$ meson.py x --buildtype release --strip -Db_lto=true

@Kaiju-A @doublejumper Does calling meson.py work for you?

yes.
another problem arose
$ meson.py x --buildtype release --strip -Db_lto=true
Error during basic setup:

Neither directory contains a build file meson.build.

yes.

:+1:

You need to execute this command from the _scrcpy_ root project directory.

how exactly

how exactly

git clone https://github.com/Genymobile/scrcpy
cd scrcpy

https://github.com/genymobile/scrcpy#common-steps

is this it
ADMIN@Adeidrick-EXT MINGW32 /c/Users/ADMIN/Desktop/scrcpy-windows-v1.1
$ meson.py x --buildtype release --strip -Db_lto=true
Traceback (most recent call last):
File "C:/msys32/mingw32/bin/meson.py", line 17, in
from mesonbuild import mesonmain
File "C:/msys32/mingw32/lib/python3.5/site-packagesmesonbuildmesonmain.py", line 20, in
from . import environment, interpreter, mesonlib
File "C:/msys32/mingw32/lib/python3.5/site-packagesmesonbuild\environment.py", line 16, in
from . import coredata
File "C:/msys32/mingw32/lib/python3.5/site-packagesmesonbuild\coredata.py", line 208, in
'prefix' : [ UserStringOption, 'Installation prefix.', default_prefix() ],
File "C:/msys32/mingw32/lib/python3.5/site-packagesmesonbuildmesonlib.py", line 186, in default_prefix
return 'c:/' if is_windows() else '/usr/local'
File "C:/msys32/mingw32/lib/python3.5/site-packagesmesonbuildmesonlib.py", line 91, in is_windows
platname = platform.system().lower()
File "C:/msys32/mingw32/lib/python3.5\platform.py", line 1095, in system
return uname().system
File "C:/msys32/mingw32/lib/python3.5\platform.py", line 990, in uname
release, version, csd, ptype = win32_ver()
File "C:/msys32/mingw32/lib/python3.5\platform.py", line 571, in win32_ver
maj, min, build = _get_real_winver(*winver[:3])
File "C:/msys32/mingw32/lib/python3.5\platform.py", line 505, in _get_real_winver
from ctypes import (c_buffer, POINTER, byref, create_unicode_buffer,
File "C:/msys32/mingw32/lib/python3.5\ctypes__init__.py", line 7, in
from _ctypes import Union, Structure, Array
ImportError: DLL load failed: %1 is not a valid Win32 application.

I've solved my issue.
Running meson.py solved it initially. Then it said there was no file "x", so i created the directory. But then it said i had v35.something, when the project required >=37. So i ran pacman -Syu to synchronise the pacman database (because it said v35 was latest) and updated meson to v44 along with some dependencies. Then tried running again and it didn't find meson.py, so i switched back to just meson and i can progress now.
TL;DR: sync pacman databases and update meson before trying to run it

feel like i have done something wrong

$ meson x --buildtype release --strip -Db_lto=true
Traceback (most recent call last):
File "C:/msys32/mingw32/bin/meson", line 17, in
from mesonbuild import mesonmain, mesonlib
File "C:/msys32/mingw32/lib/python3.6/site-packagesmesonbuildmesonmain.py", line 18, in
from . import environment, interpreter, mesonlib
File "C:/msys32/mingw32/lib/python3.6/site-packagesmesonbuild\interpreter.py", line 22, in
from .wrap import wrap, WrapMode
File "C:/msys32/mingw32/lib/python3.6/site-packagesmesonbuild\wrap\wrap.py", line 17, in
import urllib.request, os, hashlib, shutil, tempfile, stat
File "C:/msys32/mingw32/lib/python3.6\urllib\request.py", line 84, in
import base64
File "C:/msys32/mingw32/lib/python3.6\base64.py", line 11, in
import binascii
ImportError: DLL load failed: %1 is not a valid Win32 application.

found the problem. i was using the wrong folder.

another road bloack

$ ninja
[1/1] Generating scrcpy-server with a custom command.
FAILED: server/scrcpy-server.jar
"bash" "C:/Users/ADMIN/Desktop/scrcpy/server/./scripts/build-wrapper.sh" "../server/." "server/scrcpy-server.jar" "release"
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • What went wrong:
    Unable to start the daemon process.
    This problem might be caused by incorrect configuration of the daemon.
    For example, an unrecognized jvm option is used.
    Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.1/userguide/gradle_daemon.html

    Please read the following process output to find out more:

Error occurred during initialization of VM
Could not reserve enough space for 1572864KB object heap

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org
    ninja: build stopped: subcommand failed.

more info
$ ninja
[1/10] Compiling C object app/scrcpy@exe/src_fpscounter.c.obj.
[2/10] Compiling C object app/scrcpy@exe/src_frames.c.obj.
[3/10] Generating scrcpy-server with a custom command.
FAILED: server/scrcpy-server.jar
"bash" "C:/Users/ADMIN/Desktop/scrcpy/server/./scripts/build-wrapper.sh" "../server/." "server/scrcpy-server.jar" "release"
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

  • What went wrong:
    Unable to start the daemon process.
    This problem might be caused by incorrect configuration of the daemon.
    For example, an unrecognized jvm option is used.
    Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.1/userguide/gradle_daemon.html

    Please read the following process output to find out more:

Error occurred during initialization of VM
Could not reserve enough space for 1572864KB object heap

after some quick maths finally got it to build

ADMIN@Adeidrick-EXT MINGW32 /c/Users/ADMIN/Desktop/scrcpy/x
$ ninja
[1/10] Compiling C object app/scrcpy@exe/src_fpscounter.c.obj.
[2/10] Compiling C object app/scrcpy@exe/src_main.c.obj.
[3/10] Compiling C object app/scrcpy@exe/src_screen.c.obj.
[4/10] Compiling C object app/scrcpy@exe/src_frames.c.obj.
[5/10] Compiling C object app/scrcpy@exe/src_server.c.obj.
[6/10] Compiling C object app/scrcpy@exe/src_scrcpy.c.obj.
[7/10] Compiling C object app/scrcpy@exe/src_decoder.c.obj.
[8/10] Compiling C object app/scrcpy@exe/src_inputmanager.c.obj.
[9/10] Linking target app/scrcpy.exe.
[10/10] Generating scrcpy-server with a custom command.
:server:preBuild UP-TO-DATE
:server:preReleaseBuild UP-TO-DATE
:server:compileReleaseAidl UP-TO-DATE
:server:compileReleaseRenderscript UP-TO-DATE
:server:checkReleaseManifest UP-TO-DATE
:server:generateReleaseBuildConfig UP-TO-DATE
:server:prepareLintJar UP-TO-DATE
:server:generateReleaseResValues UP-TO-DATE
:server:generateReleaseResources UP-TO-DATE
:server:mergeReleaseResources UP-TO-DATE
:server:createReleaseCompatibleScreenManifests UP-TO-DATE
:server:processReleaseManifest UP-TO-DATE
:server:splitsDiscoveryTaskRelease UP-TO-DATE
:server:processReleaseResources UP-TO-DATE
:server:generateReleaseSources UP-TO-DATE
:server:javaPreCompileRelease UP-TO-DATE
:server:compileReleaseJavaWithJavac UP-TO-DATE
:server:compileReleaseNdk NO-SOURCE
:server:compileReleaseSources UP-TO-DATE
:server:lintVitalRelease
:server:mergeReleaseShaders UP-TO-DATE
:server:compileReleaseShaders UP-TO-DATE
:server:generateReleaseAssets UP-TO-DATE
:server:mergeReleaseAssets UP-TO-DATE
:server:transformClassesWithPreDexForRelease UP-TO-DATE
:server:transformDexWithDexForRelease UP-TO-DATE
:server:mergeReleaseJniLibFolders UP-TO-DATE
:server:transformNativeLibsWithMergeJniLibsForRelease UP-TO-DATE
:server:processReleaseJavaRes NO-SOURCE
:server:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:server:packageRelease UP-TO-DATE
:server:assembleRelease

BUILD SUCCESSFUL in 10s
24 actionable tasks: 1 executed, 23 up-to-date
Picked up _JAVA_OPTIONS: -Xmx512M

but ninja run doesnt work

ADMIN@Adeidrick-EXT MINGW32 /c/Users/ADMIN/Desktop/scrcpy/x
$ ninja run
[0/1] Running external command run.
Could not execute command "scripts/run-scrcpy.sh": [WinError 193] %1 is not a valid Win32 applic ation
FAILED: meson-run
"C:/msys32/mingw32/bin/python3.exe" "C:/msys32/mingw32/bin/meson" "--internal" "commandrunner" " C:/Users/ADMIN/Desktop/scrcpy" "C:/Users/ADMIN/Desktop/scrcpy/x" "" "C:/msys32/mingw32/bin/pytho n3.exe" "C:/msys32/mingw32/bin/meson" "scripts/run-scrcpy.sh"
ninja: build stopped: subcommand failed.

keep on getting this error, reinstalled the packages , still the same thing

Even I encounter this error and can't resolve but if ninja command completes successfully you can run ninja install & scrcpy command.

I was getting this error when i incorrectly installed the x86 (32-bit) libraries in 64 bit MSYS2
reinstalling the correct version to the MSYS2 you are running (on windows it you have both options) resolved the issue

ninja run

throws an error

[0/1] Running external command run.
Could not execute command "scripts/run-scrcpy.sh": [WinError 193] %1 is not a valid Win32 application
FAILED: meson-run

and when i copy the compiled scrcpy.exe from /app subfolder to my directory with adb and other required dlls, running it does not bring anything on screen.

EDIT: btw, I'm trying to build the 'dev' branch
EDIT 2: it appears the fresh build is referencing newer libraries vs. the ones in the folder, e.g. avformat-58.dll (vs avformat-57.dll in the folder)
EDIT 3: downloaded the missing libraries, and had to rename the file to scrcpy.exe (had copied it as scrcpy2.exe) .... now its working !!

ninja run got the same error as @Kaiju-A .
but ninja install successful, and I just run scrcpy.exe directly worked. (On Windows)

sb 你没装meson

Was this page helpful?
0 / 5 - 0 ratings

Related issues

swamikamal picture swamikamal  Â·  3Comments

BloodPHamtOm picture BloodPHamtOm  Â·  3Comments

mttmllns picture mttmllns  Â·  3Comments

udit7395 picture udit7395  Â·  4Comments

npes87184 picture npes87184  Â·  3Comments