matrix-org / matrix-org/matrix-rust-sdk

Error while building matrix-sdk-crypto-ffi for Android target

Open
#4,042 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.3k
Forks
500
Avg merge
1d 16h
Merged PRs (30d)
106

Description

HOST OS: macOS Sonoma 14.3

I'm currently trying to build matrix-sdk-crypto-ffi on main branch with:

cargo build --target=aarch64-linux-android

And I get the following error log:

warning: libsqlite3-sys@0.28.0: Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `aarch64-linux-android-clang` installed?

error: failed to run custom build command for `libsqlite3-sys v0.28.0`

Caused by:
  process didn't exit successfully: `/Users/natycaldas/Documents/matrix-rust-sdk/target/debug/build/libsqlite3-sys-e5814bfbabc10d7a/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=LIBSQLITE3_SYS_USE_PKG_CONFIG
  cargo:include=/Users/natycaldas/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libsqlite3-sys-0.28.0/sqlite3
  cargo:rerun-if-changed=sqlite3/sqlite3.c
  cargo:rerun-if-changed=sqlite3/wasm32-wasi-vfs.c
  cargo:rerun-if-env-changed=SQLITE_MAX_VARIABLE_NUMBER
  cargo:rerun-if-env-changed=SQLITE_MAX_EXPR_DEPTH
  cargo:rerun-if-env-changed=SQLITE_MAX_COLUMN
  cargo:rerun-if-env-changed=LIBSQLITE3_FLAGS
  OUT_DIR = Some(/Users/natycaldas/Documents/matrix-rust-sdk/target/aarch64-linux-android/debug/build/libsqlite3-sys-fb29c7623cd9f3eb/out)
  TARGET = Some(aarch64-linux-android)
  OPT_LEVEL = Some(0)
  HOST = Some(aarch64-apple-darwin)
  cargo:rerun-if-env-changed=CC_aarch64-linux-android
  CC_aarch64-linux-android = None
  cargo:rerun-if-env-changed=CC_aarch64_linux_android
  CC_aarch64_linux_android = None
  cargo:rerun-if-env-changed=TARGET_CC
  TARGET_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
  cargo:warning=Compiler family detection failed due to error: ToolNotFound: Failed to find tool. Is `aarch64-linux-android-clang` installed?
  RUSTC_WRAPPER = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some(false)
  cargo:rerun-if-env-changed=CFLAGS_aarch64-linux-android
  CFLAGS_aarch64-linux-android = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_linux_android
  CFLAGS_aarch64_linux_android = None
  cargo:rerun-if-env-changed=TARGET_CFLAGS
  TARGET_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None

  --- stderr


  error occurred: Failed to find tool. Is `aarch64-linux-android-clang` installed?

My ~/.cargo/config.toml has the following key

[target.aarch64-linux-android]
linker = "/opt/homebrew/Caskroom/android-ndk/27b/AndroidNDK12297006.app/Contents/NDK/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android35-clang"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ~/.cargo/config.toml and reproduce the cargo build --target=aarch64-linux-android command for matrix-sdk-crypto-ffi. Compare the configured Android linker with the tool expected by libsqlite3-sys; done means the Android target builds without the missing aarch64-linux-android-clang error.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, rust
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.