-
-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed to run build-wrapper.sh within MSYS2 #2881
Comments
1.21? |
Does it work at least with the prebuilt server? (for me it works) However, I don't have a Windows VM with everything ready to build the server with Android currently. @Biswa96, could you reproduce? |
@Biswa96 Sorry, I notified you because I remembered that you have some experience with MSYS2/Windows, without much context :) The author of this issue reports that a full build (including the server) from MSYS2 fails. On Windows, I can build with a prebuilt server without issue, but I currently could not test without a prebuilt server (i.e. building the Android server also from MSYS2). I asked in case you already had an environment with everything available, but if you don't, I'll take time to install an Android environment in my Windows VM. |
After reading some Stackoverflow answers, I can now build scrcpy-server with AndroidStudio. I ran the commands as your documentation suggests. Ninja can successfully executes gradle build job. |
@rom1v , thanks a lot, I often see your answers in scrcpy issues.
Right now, I build it with a prebuilt server and it works. (But for some reasons, I still need to build without the prebuilt server.)
Sorry, I should leave the commit id: 5704ec6967c03510dd7d206e5f59c1e4fd6e10a0 (on master branch) |
@Biswa96 Sounds like good news to me! Thanks for your support, and would you like to share the steps or problems encountered? (I encountered a bunch of things such as OpenJDK 17 is not supported by Gradle 7.0.x. And it also takes me some time to find out and purge the |
These command may differ in your case. I have installed Android Studio from ZIP file. I just added these environments.
And then run meson and ninja command as mentioned in docs. |
@rom1v @Biswa96 thank you two for helping me. After reading ninja docs and do some tests, finally, I find the reason. When running the following scripts ( build server/scrcpy-server: CUSTOM_COMMAND | D$:/workspace/scrcpy_gh/server/./scripts/build-wrapper.sh PHONY
pool = console
COMMAND = "bash" "D:/workspace/scrcpy_gh/server/./scripts/build-wrapper.sh" "D:/workspace/scrcpy_gh/server" "server/scrcpy-server" "release"
description = Generating$ server/scrcpy-server$ with$ a$ custom$ command Ninja strangely starts using the bash from WSL2 instead of MSYS2, so it fails to locate |
Would it be better if a CI script is added for msys2 windows build? Though the .exe file will be dynamically linked with ffmpeg and sdl. |
In theory, maybe, but I don't have a CI yet (for any platform). There is #1709, but there were still issues (if checkstyle was enabled it did not work for some reason), and I did not work on it since then. |
Just realized that I can reproduce this issue in my PC. I generally delete bash, ssh etc. from System32 to workaround any conflict with msys2 and cygwin. Here is the output if system32/bash.exe present:
GitHub Actions CI also shows same error with msys2 environment. I assume that the issue comes from find_program() in server/meson.build file. Is it possible to invoke gradle from meson instead of going through a shell script? |
Environment
Describe the bug
I am trying to build scrcpy from source without prebuilt server. Thanks to the docs, it is not painful to set up the environment. But still, I encountered something confusing when executing
ninja -Cx
.MSYS2 reported errors:
I dug it out and found some code in
.\x\build.ninja
that related to it:But if i run it manually, there was nothing wrong:
Can anyone give me some help? Why did the scripts fail here?
Update: It seems the path
D$:/workspace/scrcpy_gh/server/scripts/build-wrapper.sh
is not recognized correctly. But I still don't know why.The text was updated successfully, but these errors were encountered: