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

Servo on Android can't load remote URLs #2453

Closed
ebalint opened this issue May 16, 2014 · 10 comments
Closed

Servo on Android can't load remote URLs #2453

ebalint opened this issue May 16, 2014 · 10 comments

Comments

@ebalint
Copy link
Contributor

ebalint commented May 16, 2014

I was testing it on PandaBoard 4430 with Android 4.1.2

Adb logcat:

https://gist.github.com/ebalint/0c9827e6559807ca97fe

@aydinkim
Copy link

I've made a simple socket example which uses rust(arm)'s basic socket and failed on my device as well :(
Though I had pushed a android internet permission into the manifest in the past.

Afaik, Rust socket of arm has never been tested yet. (I'm not sure!)
It looks a critical problem of servo-android.

I just think we should make sure that rust socket of arm works well at first.

@ebalint
Copy link
Contributor Author

ebalint commented May 20, 2014

Can you upload your code? I think this error occurs only on ARM Android, because on ARM Linux (Ubuntu) it doesn't fail at this point.

@aydinkim
Copy link

@ebalint I used rust-http example in https://github.com/mozilla-servo/rust-http/blob/servo/src/examples/client/main.rs
I'm just curious that how did you build the arm-linux-ubuntu binary? used android ndk cross toolchain?
(According to https://github.com/mozilla/rust/wiki/Note-build-system, there is no arm-linux-gnueabi build target)

If it works well on the arm-linux,
I guess the problem is from either a android specific permission or libuv-android internal.
(differences between bionic and libc? I have no idea at this moment)
rust-lang/rust#6567

I'm not sure but maybe there has been no one who had fully checked operability of uv socket of android.

We can find out it sooner :)

@ebalint
Copy link
Contributor Author

ebalint commented May 21, 2014

The build system needed a little bit of hacking, and I created a few patches as well. If you are interested I can send you them via email.

How can I compile this rust-http example? Because compilation fails for me because of the dependencies.

@aydinkim
Copy link

For simply, You should install the bunch of Rust files into your own system using 'sudo make install'. You can copy the example file to certain directory you want. And rust-http library should be located in the same directory. Simply you can obtain rust-http shared library after Servo-Arm build. And run 'rustc -L. -lrust-http main.rs'. You might get a executable file. (I'm not sure that that command must contain '-lrust-http'. I cannot remember, sorry)

If you want to run that executable binary on your android system, you need to copy all the rust native files such as librustuv-xx, libnative-xx, libstd-xx and so forth must be located at /system/lib of Android and executable binary need to be in the /system/bin.
Maybe you can launch the example on the device.
If it is failed with some dependency problem, you can change the environmental variables like 'LD_LIBRARY_PATH=(LOCATION OF YOUR RUST LIBRARIES IN YOUR DEVICE):$LD_LIBRARY_PATH'

If you have some problem so far, let me know with more details and I can help you more!

@aydinkim
Copy link

@ebalint Works well?

@ebalint
Copy link
Contributor Author

ebalint commented May 22, 2014

@aydinkim Yes, thank you for the instructions. I successfully compiled it and it works well, the http response appeared on the console as a result.

@aydinkim
Copy link

@ebalint I'm pleased since you've made a good work. The example works well? I'd wonder if you let me know what exactly is the solution. In my case, it doesn't works well. you'd added kind of android permission?

@ebalint
Copy link
Contributor Author

ebalint commented May 27, 2014

@aydinkim The example works only on ARM Ubuntu. On Android I didn't try it because i don't know how to put the example into an NDK project.

@ebalint
Copy link
Contributor Author

ebalint commented Oct 13, 2014

I think this issue can be closed. I tested it on revision:7a5f1 and it works.

@jdm jdm closed this as completed Oct 13, 2014
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