Skip to content
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

Unable to build from source #32

Closed
WaterBoiledPizza opened this issue Feb 26, 2024 · 11 comments
Closed

Unable to build from source #32

WaterBoiledPizza opened this issue Feb 26, 2024 · 11 comments

Comments

@WaterBoiledPizza
Copy link

System: Windows 10
Python: 3.11.8

I am currently following the build instruction for Android and found multiple errors:

ERROR: An error occurred during the fetch of repository 'local_execution_config_python':
...
Error in fail: Repository command failed
INFO: Could not find files for the given pattern(s).
ERROR: C:/users/user/downloads/ownprojects/gdmp/mediapipe/WORKSPACE:544:14: fetching local_python_configure rule //external:local_execution_config_python: Traceback (most recent call last):
...
Error in fail: Repository command failed
INFO: Could not find files for the given pattern(s).
ERROR: Analysis of target '//GDMP/android:GDMP' failed; build aborted: Repository command failed
INFO: Could not find files for the given pattern(s).

I searched for clues that might cause this error, and it indicates that Bazel fails to find the local Python binary, but the Python binary referenced if from setup.py, which should be valid. Here are the python path and the build args from the code for reference

python_path: C:\\Users\\User\\Downloads\\ownprojects\\GDMP\\venv\\Scripts\\python.exe
build_args: ['C:\\ProgramData\\chocolatey\\bin\\bazelisk.EXE', 'build', '--action_env', 'PYTHON_BIN_PATH=C:\\\\Users\\\\User\\\\Downloads\\\\ownprojects\\\\GDMP\\\\venv\\\\Scripts\\\\python.exe', '-c', 'dbg', '--config=android', '--copt=-fPIC', '--cpu=arm64-v8a', '//GDMP/android:GDMP']

Do you have any clue how to solve this issue? Many thanks!

@WaterBoiledPizza
Copy link
Author

Can you also specify the versions of the tools used as of the building of the plugin? So i can check with mine. Thank you.

  • System
  • Python
  • Bazel/ Bazelisk
  • VS Build tool
  • OpenCV
    and any other tools i might have missed. Thank you.

@j20001970
Copy link
Owner

I was able to get past the Python error, but ended up stuck at headers and compiler flags mixup between Android toolchain and MSVC. I think it is currently not possible to cross compile Android library on Windows, please set up WSL or Linux VM instead.

My Windows spec:

  • Windows 10 22H2
  • Python 3.11.7
  • Bazel 6.1.1

@WaterBoiledPizza
Copy link
Author

WaterBoiledPizza commented Feb 27, 2024

Thank for the info! I am able to build it for Android and Linux using a ubuntu VM. One problem I found is that the GDMP I built for Android is a lot laggier than the one included in the GDMP-demo (built with build.py android --arch arm64-v8a, tested on a Pixel 6). Do you have any clue to why that'd happen?

Also do you build GDMP for Windows on Linux? I've also encountered several errors when trying that.

@j20001970
Copy link
Owner

a lot laggier than the one included in the GDMP-demo (built with build.py android --arch arm64-v8a

build.py builds debug version by default, you can specify --type release in the build command.

do you build GDMP for Windows on Linux?

Cross-compile Windows library on Linux is currently not supported, I personally use Windows VM for that.

@WaterBoiledPizza
Copy link
Author

Sorry for opening the issue again. I am now able to build for android, linux and windows, and currently trying to build for ios with the ios-fix branch. When I tried to use the compiled library for ios in the godot project (GDMP demo) and export it, it throws an error:
error: Building for iOS, but the linked and embedded framework 'GDMP.ios.debug.framework' was built for iOS + iOS Simulator. (in target 'GDMP Demo' from project 'GDMP Demo')

Do i change the setting in godot to make it ios + simulator, or change in the build setting to make it ios only? Thank you again!

@j20001970
Copy link
Owner

error: Building for iOS, but the linked and embedded framework 'GDMP.ios.debug.framework' was built for iOS + iOS Simulator. (in target 'GDMP Demo' from project 'GDMP Demo')

Are you building the Xcode project for simulator, or exporting to real iOS devices? Some details about the environment would help as well, such as Xcode version, built library architecture inside GDMP.ios.debug.framework (by running lipo -info the_library )

@WaterBoiledPizza
Copy link
Author

WaterBoiledPizza commented Feb 28, 2024

I am planning to export it to iOS.

  • XCode version: 15.2
  • built library architecture inside GDMP.ios.debug.framework: x86_64, arm64

Should i just build it for either x86_64 or arm64? If it's for iPad, is it arm64? I now build with just --arch arm64 and am able to export project to XCode. Onto testing the library on an iOS device

@WaterBoiledPizza
Copy link
Author

Following up of this journey of having GDMP on iOS device. Not sure if this is a Godot issue or the library issue, but the mediapipe tasks are not starting.

i've built the --type release --arch arm64 library and imported it to the GDMP-demo project. Added the messages for privacy permissions (Camera, photo and mic access). The app is able to be installed and opened, and i can navigate to the Hand Landmarker task, but upon clicking the Open camera button, nothing happens.

I went and check the process. I suspect it might be an issue about requesting permission with the camera helper, which did not show up, hence no _permission_result() callback and the program cannot proceed.

FYI, I am using iPad Air 5th generation for testing

@j20001970
Copy link
Owner

Thank you for the information details. I can confirm that camera helper is currently broken on iOS, since there are previous reports about it outside the repository.

I think it is better to open another issue for this iOS camera problem, and it'll be appreciated if you would like to help, as I have no real iOS devices to test camera functionality, and iOS simulator doesn't provide any sort of that for development.

@WaterBoiledPizza
Copy link
Author

Where can I find the previous reports about it outside the repository? I want to take a look at them and understand more about what might have caused the issue.

@j20001970
Copy link
Owner

Where can I find the previous reports about it outside the repository? I want to take a look at them and understand more about what might have caused the issue.

Sorry for taking that long to reply.

The reports take place in messaging app that discussion is not public on internet, but I can provide some details regarding iOS camera problem:

  • The reports started around 2023/10, some might have changed or fixed.
  • The reports use Godot 3.x (GDNative) version of GDMP library, not sure if the behaviours are the same for 4.x.
  • Camera helper usage has been refactored without testing on iOS during the first working version (v0.2) and current master branch, mainly from producing camera frame packets to wrapping camera frames with mediapipe::Image class, and some code deduplication.
  • The problem ultimately tracked to camera helper producing null MediaPipeImage.

To sum up, I suspect the root cause would be camera helper from iOS implementation not handling camera frames properly during refactor, but I have no actual device to verify that. If you feel the reports are not accurate anymore, we should track the problems from the ground up by checking if MediaPipeCameraHelper actually calls into iOS implementation first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants