Open Mygod opened 4 years ago
What do you mean by "current platform?"
I'm going to have to do some testing on this. Also I'm not fully sure I understand the issue...
I mean that this doesn't work with the fix we have in place for https://github.com/mozilla/rust-android-gradle/issues/10.
Edit for clarification: target/$toolchain/$profile/...
is wrong if you're on e.g. macos and doing a build for macos desktop, it would just be target/$profile/...
.
Sorry, my bad, I just realized this code is inside a branch that only runs for non-desktop builds. It probably still applies but I'm not really worried about people building android apps on android.
That said, I'll still need to do some testing of it before I cut a release.
Fixed.
No further comments?
Sorry, I’ve been sick, and I need to find time to test, probably later this week. I’d also like to better understand the motivation here.
The workaround is from https://github.com/rust-lang/cargo/issues/1706#issuecomment-563889929, the soname
flags did not seem to work for us.
The new patch should fix things in a simpler way. Not sure why you would want to compile non-Android binaries with this plugin though.
The new patch should fix things in a simpler way. Not sure why you would want to compile non-Android binaries with this plugin though.
We compile the same code for Desktop platforms to run unit tests against it -- it's really nice :)
I'll test this out (and cut a release assuming it works) later today or tomorrow, sorry for the delay here (I was sick, but am not anymore).
Alright but if the unit tests are written in rust, probably there is no need to bundle them into apk so I guess my patch still makes sense. :)
Alright but if the unit tests are written in rust
@ncalexan meant android unit tests. Example: https://github.com/mozilla/application-services/blob/master/components/logins/android/src/test/java/mozilla/appservices/logins/DatabaseLoginsStorageTest.kt is testing the rust code in this crate https://github.com/mozilla/application-services/tree/master/components/logins and it "just works" and automatically builds the shared library for the current platform and runs it via robolectric.
Yes, this doesn't work for local unit tests. I'll update the code to the sample project in this repository that demonstrates this so that you can test against that.
Again, sorry for all the issues here.
@Mygod I saw email from you a few days ago, but now I can't find the comment on GH.
I can't really tell what the issue you are trying to solve is. If I understand correctly, you are trying to put a Rust binary executable into an Android APK, and then to run that executable on a device? I have a spare half hour, I'll try to see if that can be done already.
Tested via https://github.com/shadowsocks/shadowsocks-android/commit/5ea3e3559adfb7b779ba6f3f633a02b3bcf50145.