-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Package request: Rust and Cargo #261
Comments
I was about to request this. I also would love to see rust added to the collection. In fact, termux with a full compiler collection is becoming a very valuable tool. |
Good news for cross-compilation of Rust and Cargo on termux :) |
Rustup doesn't work on termux (which is not a termux bug, just pointing out that rustup is not a solution) $ curl -sSf https://static.rust-lang.org/rustup.sh | sh |
@andreiw, sure, but using rustup on a pc os, you can easily compile the rust compiler for arm architectures i presume 😄 |
The link is pointing to the wrong place in the OP comment https://github.com/warricksothr/RustBuild Same with this one |
Has anyone tested if rustup is working for ARM7 cpus? @andreiw seemed to try it on ARM64 |
Getting a permission denied error on rustup.sh in termux, chmod a+x doesn't help |
Rust isn't a bad match. It's also using the LLVM backend, which should already be installed since Termux comes with the clang toolchain. |
Edit the script and insert the correct shell path in the shebang. I think it's |
Trying a different approach which is still relevant to the topic: Downloaded rustup-init (the arm7 build), copied it to /data/local, switched to su and chmod +x rustup-init, then tried to run it. I now get a different error but I think this may be more relevant.
Edit: used this build rustup-init |
I get the same error as @wrsg. |
The rustup-init tool isn't available to android, yet. The only way to get rust on android will be through cross compiling it. I have tried it but I am not that familiar with their build system. |
@vishalbiswas The next version of rust is switching to a new build system that requires Python, so it may be wise to wait until that version before doing any serious packaging. |
just my 2 cents on my attempts at building rust, |
@Luke-Nukem you mean 1.16 or 1.17? |
@vishalbiswas I think 1.16, iirc. You can build it without the python based build system (rustbuild) via It may be worth grabbing a precompiled binary from https://static.rust-lang.org/dist/index.html to try, if this works, then you can use that to build rust with
|
@Luke-Nukem thanks for your reply. file rustup-init
rustup-init: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 4.2.6, not stripped, with debug_info
$ ./rustup-init
-bash: ./rustup-init: No such file or directory btw same happens when i try to run precompiled rustc, which is again what it tries to run when bootstrapping itself |
@kirillrdy That rustup binary was compiled for aarch64-linux-gnueabi not aarch64-linux-androideabi. |
I am getting this error in the latest rustup script sTux at cmbox in ~ |
But there is no latest rustup script that works on android is there? I tried to manually cross-compile rustup but that seems to be blocked by rust-lang/libc#511 I don't know if that only affects rustup itself and there is another way to install rustc + cargo or if that means it just doesn't work at the moment. |
Seems like this may be easier once the Rust devs actually enable this as they plan to |
It seems mozilla is providing an Cross-compilation of individual programs, like ripgrep, should be doable, provided you already had a working cross-compiler/ndk. I believe the person to go to for help could be @japaric |
Add android build support We do not have rustc and cargo binary for Android yet, but I'm working on it (there is some interest on this - termux/termux-packages#261)
Add android build support We do not have rustc and cargo binary for Android yet, but I'm working on it (there is some interest on this - termux/termux-packages#261)
Add android build support We do not have rustc and cargo binary for Android yet, but I'm working on it (there is some interest on this - termux/termux-packages#261)
Requires #879 |
Great news |
Disclaimer: I know nothing about termux packaging. In fact, I just learned about this project recently. So I'm approaching the problem of making Cargo / rustc available on Android (and Chrome books?) by having official binaries installable via rustup. But if the official Rust build systems support building Cargo and rustc for Android then it should be easy to have the Termux packaging system leverage that build system to create proper Termux packages I got both Cargo and rustc working on my Android phone (used Cross (*) and the vanilla Rust build system to build them, respectively) but I can't compile Hello World because gcc (what rustc uses to link binaries, by default) is not available for installation. clang may work but I can't try it right now because I seem to have borked my termux install and can't install anything ( (*) Thanks @malbarbo for adding Android support to Cross! ❤️ If clang and gcc have the exact same CLI when used as linkers then rustc should work fine when paired with clang. But if that's not the case then we'll have to patch rustc to support both gcc and clang to link Android binaries. There's some groundwork to support that scenario in rust-lang/rust#40018. |
@japaric little hint, you can use |
@japaric Nice work! I have rustc and cargo working in my phone and it is capable of producing binaries (I assume it is using clang linker, because gcc in termux calls clang). I have some PR to send to rust that adds android host builds. I'm just waiting some other changes to get merged. There is also a discussion of the minimum android api level that rust must support. rustup 1.1 was released yesterday with android builds. To install rustup run When we got rust and cargo nightly for android, we will be able to install them using rustup! |
@vishalbiswas Thanks for the
Yes, I produced rustc via cross compilation and that also cross compiles LLVM as part of the build process. So this rustc is statically linked to Rust's fork of LLVM. There's an option to link against system LLVM but I think that can only be used with native builds. @malbarbo Excellent! Can confirm that using clang as a linker works without a hitch 👍. |
@japaric |
I made a PR to add host builders for android. This would allow installing rustc and cargo using rustup. We have a capacity issue and it is not possible to build rustc for all android archs. So I would like to ask: Which arch support is more important to you? Are you interest in rustc running in your phone or chomebook? Maybe some of you can go to the PR page and write why rustc support on android is important to you. |
armv7-a seems to be the most ubiquitous/compatible |
my vote would be for aarch64 and if possible x86_64 ( lenovo tablet) |
@ssokolow emitted this gem of wisdom:
She's a little slow, isn't she? (on the uptake probably) |
@MineFuehrer As for my comment, in case you need clarification, whatever competition Rust may have with Nim is of the "other programming languages do exist" variety, not the "Oh my God! Stop the presses! My high school rival got a point on me! I must react!" variety. I got the impression your goal was to manipulate people to hurry up with packaging Rust by saying "Look! Your rival is beating you!" but Nim is not Rust and what Nim does has no more bearing on how the mature adults in this thread will behave than what Brainf*ck, INTERCAL, or Ook! do.... so I repeat: "They were first to be packaged? Good on them, but it's off-topic." |
Ah, my mistake! I thought it was a ship about to hit an iceberg. Can't wait, carry on! |
What prevents me from installing via the shellscript? |
@Serkan-devel you can try, it seems to work for some people and not others. even if it were working, this is a package request to get working binaries of rust into the termux repo. |
I'm trying to install Rust via the
This is on a Dell Chromebook 7310 (ChromeOS version 67.0.3396.99) with Intel Core i3 processor with a clean install of Termux version 0.64. How can I install libssh2? I get the error |
Fixed it |
Thanks! It works now! |
error: can't find Rust compiler This package requires Rust >=1.41.0. ---------------------------------------- ERROR: Failed building wheel for cryptography Failed to build cryptography Anyone show me the solution of this error |
It doesn't show error for me after installing rust. |
I am using termux @xeffyr |
@Avi-hs Well, I'm using Termux too and doesn't have error. |
@xeffyr thanks for giving your answer |
As the popularity of Rust grows, Rust support in Termux would be extremely helpful to both Rust experts and beginners.
The binaries and libraries of Rust and Cargo are also shown to be compilable and buildable in ARM despite the fact that they should be compiled in Rust instead of C. Hence, building Rust and Cargo packages for Termux would seem highly feasible. A link towards the corresponding Github repo is provided below.
Thanks.
RustBuild: https://github.com/warricksothr/RustBuild
The text was updated successfully, but these errors were encountered: