Closed complexspaces closed 2 years ago
Awesome! Diff looks good. Would you mind adding CI runs for this? It should only be a matter of adding targets here, just like there is for FreeBSD.
You might have to rebase because of a commit I just pushed up; I realized while typing this comment that there was some extraneous stuff in the CI file. I don't think you'll have to if you append the new runs, though.
I'm not sure why the iOS typechecking job is failing. My best guess is that Rust 1.28 didn't support the aarch64-apple-ios
target since rustup
doesn't appear to recognize it at all.
Hmm…that's probably correct. Let me do some digging to see what version it was introduced in.
I can't immediately determine what version it was introduced in, as it's not mentioned in the release notes. However, it looks like it could only be built on MacOS prior to 1.56.
How familiar are you with GitHub Actions? I think the best way would be to run on macos-latest
for this specific target. I can try this if you're not too familiar.
I can give this a try :thumbsup:
CI looks green to me now. Please let me know if there are tweaks you'd like made to it.
The MacOS check doesn't actually need to be on MacOS, as it works as expected on the Ubuntu host. But that's not a big deal. Thanks!
This PR adds support for compiling and running on Android and iOS devices.
Test Code
Android
This patch is very simple, as the existing Linux implementation already works great inside the Android app sandbox.
This was tested on both a physical Android device and in an emulator by compiling, then loading, a minimal Rust dylib via the JNI.
Output (note the thread count is always high because of the JVM in the process):
iOS
The patch for iOS, like Android, is very simple because the MacOS implementation can be reused entirely with no changes.
This was tested inside the iOS simulator and on a physical iPad.
Output (the thread count here is high too because of the Swift runtime):