Is there a Rust build for aarch64-linux-android?
Asked Answered
M

3

11

Recently I got a new smartphone with fairly beefy specs, so wanting to play around with Rust on the go I installed Termux and tried to rustup-init. However, this fails:

info: syncing channel updates for 'stable-aarch64-linux-android'
info: latest update on 2017-08-31, rust version 1.20.0 (f3d6973f4 2017-08-27)
error: target not found: 'aarch64-linux-android'

Is there another way to get a Rust environment on android?

Mireyamiriam answered 9/9, 2017 at 9:37 Comment(0)
T
9

Sadly rustup won't work on android.

You can manage to install cargo and rustc using Termux.

Also if you have rustup already installed, rm .cargo will remove the stub (which otherwise interferes with calling cargo or rustc).

Threw answered 9/9, 2017 at 11:37 Comment(3)
Can you check the path of the rustc binary, it seems you still have a conflict with rustup. On my phone, the path is /data/data/com.termux/files/usr/bin/rustcAsper
That was it! Thank you!Mireyamiriam
This is very outdated... It's Pointless removed rustc, it's now in the main Repository. The Unstable Termux repository was deleted, and rustc-nightly is disabled due to an LLVM 12 incompatibility. You can still get Rustc-dev, but many packages will only build with experimental rustc-nightly featuresRilke
M
3

There is a rust package available via pkg install rust. It contains Cargo and appears to install packages successfully.

The package source is here: https://github.com/termux/termux-packages/tree/master/packages/rust

Just a note: I had a binary failing to build during installation via Cargo due to libsqlite3-sys intermediate. This was solved by installing binutils package, which adds the archiver (ar) aarch64-linux-android-ar. The ecosystem is not flawless yet.

Mandrake answered 16/12, 2022 at 15:36 Comment(0)
S
0

or you can use rustup directly in termux. guide. all rust related tools and frameworks will work too after patching them.

Shallow answered 27/1 at 23:39 Comment(1)
Questions should be self-contained -- links are acceptable to include but they should be supplemental: someone should still be able to be helped by the answer even if all its links break.Face

© 2022 - 2024 — McMap. All rights reserved.