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

Update Dockerfile for ARM #2653

Closed
5 tasks done
rbebb opened this issue Aug 8, 2022 · 4 comments
Closed
5 tasks done

Update Dockerfile for ARM #2653

rbebb opened this issue Aug 8, 2022 · 4 comments

Comments

@rbebb
Copy link

rbebb commented Aug 8, 2022

Checklist

  • the issue is indeed a bug and not a support request
  • issue doesn't already exist: https://github.com/kivy/python-for-android/issues
  • I have a short, runnable example that reproduces the issue
  • I reproduced the problem with the latest development version (p4a.branch = develop)
  • I used the grave accent (aka backticks) to format code or logs when appropriated

Versions

  • Python: Default
  • OS: macOS Monterey (12.5) on Apple Silicon (M1)
  • Kivy: Default
  • Cython: Default
  • OpenJDK: Default

Description

Docker builds an x86 image instead of an ARM image. The Dockerfile just needs to be updated to remove references to i386 (x86). I found this out after using the P4A image as the base for another image on an M1 machine running macOS Monterey.

buildozer.spec

N/A

Logs

The following occurs after running a Docker image with the P4A image as the base image:

WARNING: The requested image’s platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
@rbebb rbebb changed the title Update Dockerfile to Build on ARM Update Dockerfile for ARM Aug 8, 2022
@tshirtman
Copy link
Member

Can this arm based image build a p4a distribution and apk on osx ? As p4a depends on the google sdk/ndk, and i don’t know if they have working arm versions.

@rbebb
Copy link
Author

rbebb commented Aug 9, 2022

@tshirtman The x86 Docker image can build a p4a distribution and an apk using macOS on Apple Silicon, but a modified Docker image for ARM cannot (even though a modified Docker image for ARM can build). It looks like Android's SDKs and NDK ≥ 24 (android/ndk#1299 (comment)) support Apple Silicon.

@rbebb
Copy link
Author

rbebb commented Aug 19, 2022

Apparently, the Android NDK is not supported on an ARM Linux Host (in my case, that'd be in the Docker container). I filed an issue on the NDK repo to see if they can add support for that: android/ndk#1752

@misl6
Copy link
Member

misl6 commented Aug 23, 2022

Hi @rbebb !

Yeah, unfortunately, Google doesn't provide an ARM Linux compatible NDK, and it looks like that is not going to happen anytime soon. (For this reason, python-for-android is incompatible also on Raspberry Pi).

I guess we can only mark this issue as "Not planned", but not due to our fault.

BTW, I've submitted a PR (and waiting for the CI to complete before the merge) that forces docker to build (and run) a linux/amd64 image also on Apple Silicon macs, even if it's not the default. The performance may not be the same as a linux/arm64, but at least it works.

See: #2660

@misl6 misl6 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2022
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

3 participants