Offst's stcompact binary is designed to work on mobile devices, specifically on Android.
We want to compile it for the following architectures:
aarch64-linux-android
armv7-linux-androideabi
i686-linux-android
More specifically, we want the CI to compile for those architectures during testing, and create a release binary when a new version tag is pushed to this repository.
Currently the automatic CI build system compiles and tests Offset for Windows, linux and macos.
Building for the Android architectures mentioned above is probably a bit different, because cross compilation is required.
I managed to perform cross compilation successfully on my machine (Ubuntu 18.04) by following the instructions from mozilla's website, with some minor modifications:
Add symbolic link: ln -s $NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang $NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-clang. Should add a similar symbolic link for the other two architectures.
Add $NDK/toolchains/llvm/prebuilt/linux-x86_64/bin to $PATH environment
variable
Create ~/.cargo/config, containing:
[target.aarch64-linux-android]
ar = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-ar"
linker = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-clang"
[target.armv7-linux-androideabi]
ar = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-android26-ar"
linker = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/arm-linux-android26-clang"
[target.i686-linux-android]
ar = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android26-ar"
linker = "/home/real/Android/Sdk/ndk/20.1.5948944/toolchains/llvm/prebuilt/linux-x86_64/bin/i686-linux-android26-clang"
Finally, create a release using cargo build --target aarch64-linux-android --release
I need some help with making this work on the travis CI. My current gap in knowledge is how to install the android SDK and the NDK on the travis CI. Alternatively, maybe travis CI has special support for this case.
Offst's
stcompact
binary is designed to work on mobile devices, specifically on Android.We want to compile it for the following architectures:
More specifically, we want the CI to compile for those architectures during testing, and create a release binary when a new version tag is pushed to this repository.
Currently the automatic CI build system compiles and tests Offset for Windows, linux and macos. Building for the Android architectures mentioned above is probably a bit different, because cross compilation is required.
I managed to perform cross compilation successfully on my machine (Ubuntu 18.04) by following the instructions from mozilla's website, with some minor modifications:
export NDK="/home/real/Android/Sdk/ndk/20.1.5948944"
ln -s $NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang $NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android-clang
. Should add a similar symbolic link for the other two architectures.$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin
to$PATH
environment variable~/.cargo/config
, containing:cargo build --target aarch64-linux-android --release
I need some help with making this work on the travis CI. My current gap in knowledge is how to install the android SDK and the NDK on the travis CI. Alternatively, maybe travis CI has special support for this case.