r/rust•
1bent

rust seems to work on android within termux

There were problems previously (version issues with llvm), but "pkg upgrade" followed by "pkg install rust" leave me with a working rustc. Now to work through the book:-)

Posted Apr 2, 2023, 3:28 PM UTC

59
llogiqclippy · twir · rust · mutagen · flamer · overflower · bytecount•

The distribution had intermittent problems a while ago, but has been working stably for at least the last 4 versions for me. Btw. helix is also packaged and works great!

7
mynewaccount838•

How do you set up rust language support in helix? If I run cargo new foo and then open up main.rs with hx foo/src/main.rs, I don't see any syntax highlighting. (I'm assuming hx is the command to run helix, I didn't see that documented anywhere but I tried it after helix didn't work.)

2
llogiqclippy · twir · rust · mutagen · flamer · overflower · bytecount•

I just ran pkg install rust-analyzer. You can also set up a ~/.config/helix/languages.toml. I may at some point add one.

1
irfan_hossain_bhy•

Currently my rust-analyzer is constantly giving me error "Filed to spawn proc amcro server".Have you facing the error too??

2
llogiqclippy · twir · rust · mutagen · flamer · overflower · bytecount•

No, but I currently don't develop that much on mobile.

1

cd foo; hx src/main.rs

1
rustological•

I was successful, too. I had to change some things in my code, as environment vars are not the same as on Linux and r/w permissions on storage made a problem with some build.rs code.

I failed to either use only microSD storage or use of network mounted storage, to prevent wearout of internal flash with every compile. Hints appreciated. The alternative would be to cross-compile from PC - don't know how much work this is to set up.

1
1bentOP•

wish I could help. I'm only beginning the rust book, far from doing anything big.

I can't help with your storage questions, either; termux-setup-storage made /sdcard available, e.g. for the Downloads directory, and Termux provides access to its internal home directory through the android file picker, e.g. for uploading files to Google Drive.

For the access to other filesystems and wear and so on, you might ask on r/termux. I expect to do anything bigger than the tiny exercises typed in from the book by ssh-ing into a dev server (I rent a VPS for such).

1