Skip to content

Allow consumers of logins-api android SDK to run unit tests that call functions implemented in Rust. #262

@thomcc

Description

@thomcc

This kind of sucks to do, but it's very hard for me to imagine that Lockbox will accept not being able to run unit tests (on-device tests in an emulator should still be possible, though, although this is a painful prospect).

Apparently we need to produce a jar file that contains both the java class files, and the compiled native code for every platform we want to support running tests on. I suspect in practice that means at least windows x86, x86_64, linux x86, x86_64, and macOS. Maybe linux arm/aarch64? Not sure.

This is a big pain. Cross compiling the rust shouldn't be a huge deal (hopefully? Supposedly rustup toolchain add can do everything), but I strongly suspect cross compiling OpenSSL/SQLcipher will suck (especially to windows and mac)

I suspect that the way to handling the native code dependencies in a sane manner will be to fetch precompiled versions.

Caveats there: On windows the ABI needs to match, and on all platforms we need to be sure to compile position independent code even though we're producing static libraries for our native code dependencies (for OpenSSL the only way I could find to build a static lib w/ PIC is to build a shared lib and grab the static lib it produces as an intermediate), since ultimately they're linked into a dynamic library.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions