metaeducation / ren-c

Library for embedding a Rebol interpreter into C codebases
GNU Lesser General Public License v3.0
126 stars 27 forks source link

Change NDK variable to ANDROID_NDK_ROOT #1116

Closed hostilefork closed 3 years ago

hostilefork commented 3 years ago

There does not appear to be a standard for the name of an environment variable where the NDK is installed. Some code on the internet seems to use $NDK, while the original Ren-C Android build scripts assumed the name was $ANDROID_NDK

With multiple environment variables in play, it's not clear what this represents...it could be the version, or whether to install it or not. So it had been changed to ANDROID_NDK_DIR to be more communicative.

However, when trying out the emulator in the android SDK (Java+tools) it turns out there is a standard for that: ANDROID_SDK_ROOT

This would make the best choice appear to be ANDROID_NDK_ROOT as it communicates that it is a directory and lines up with what the binaries in the SDK look for in its variable.

giuliolunati commented 3 years ago

Good for me!

hostilefork commented 3 years ago

@giuliolunati Good news... I have gotten Android working with the up-to-the-minute clang toolchain... while keeping the old gcc one working.

But also... the cross compiled executable is being adb push'd into an emulator, and it tests the ARM binary on the web!

Here is the part of the script where it does that:

https://github.com/metaeducation/ren-c/blob/43384ebf6cc5ece41cd24c50303dc717a88afafa/.github/workflows/android-build.yml#L401-L405

And here it is running in the emulator on GitHub:

https://github.com/metaeducation/ren-c/runs/2058853071?check_suite_focus=true#step:12:265

It would be great if we can get your APK builder running in there, too. We should be able to run the package, and poke buttons on the emulator enough to be able to get it to produce some output...that we then can look at to be fairly sure that the WASM and ARM binaries are talking to each other.

Once it all gets set up, it will be much easier to keep working!