Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Remove dependency on libusb on Android #10058

Closed
tomaka opened this issue Dec 12, 2018 · 1 comment
Closed

Remove dependency on libusb on Android #10058

tomaka opened this issue Dec 12, 2018 · 1 comment
Labels
M0-build 🏗 Building and build system. P5-sometimesoon 🌲 Issue is worth doing soon.
Milestone

Comments

@tomaka
Copy link
Contributor

tomaka commented Dec 12, 2018

Cross-compiling to Android is quite tricky because of libusb-sys.
paritytech/libusb-sys#4 fixed the fact that we were in reality compiling for Linux when trying to compile libusb for Android.

However this unveiled the problem that libusb actually doesn't support Android that well: https://github.com/paritytech/libusb-sys/blob/4418e92c82509d1f049f7942dffe62a0bf5dd871/libusb/libusb/core.c#L60

There are instructions to build libusb for Android here: https://github.com/paritytech/libusb-sys/blob/4418e92c82509d1f049f7942dffe62a0bf5dd871/libusb/android/README
However you are supposed to use ndk-build to do that, and we don't necessarily want to rewrite this tool in Rust.

Right now on Android we are building libusb manually, but in order to do so we apply a patch on the source code, which is extremely hacky.
Libusb on Android seems to have quite a few runtime issues as well.

A final solution is to remove the dependency on libusb on Android. This is probably the most simple solution, and the one I would suggest. Nobody uses our Android build yet, so we won't break anything.

I'm opening this issue to gather opinion. Any comment on this?

cc #9893 @TriplEight

@tomaka tomaka added P5-sometimesoon 🌲 Issue is worth doing soon. M0-build 🏗 Building and build system. labels Dec 12, 2018
@ordian
Copy link
Member

ordian commented Dec 13, 2018

However this unveiled the problem that libusb actually doesn't support Android that well: https://github.com/paritytech/libusb-sys/blob/4418e92c82509d1f049f7942dffe62a0bf5dd871/libusb/libusb/core.c#L60

I think for Android it defined OS_LINUX:
https://github.com/paritytech/libusb-sys/blob/4418e92c82509d1f049f7942dffe62a0bf5dd871/libusb/android/config.h#L36

Libusb on Android seems to have quite a few runtime issues as well.

libusb/libusb#242

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
M0-build 🏗 Building and build system. P5-sometimesoon 🌲 Issue is worth doing soon.
Projects
None yet
Development

No branches or pull requests

3 participants