Hacker News new | comments | ask | show | jobs | submit login

It's not mentioned in the post, but 1.8 also includes support for installing additional versions of the stdlib for other targets using rustup/multirust[1], which is huge for cross compilation:

  $ rustup target add x86_64-unknown-linux-musl
  info: downloading component 'rust-std' for 'x86_64-unknown-linux-musl'
  13.77 MiB / 13.77 MiB (100.00%) 1.47 MiB/s ETA: 0s
  info: installing component 'rust-std' for 'x86_64-unknown-linux-musl'
Which allows:

  $ cargo build --target x86_64-unknown-linux-musl
You can get a list of available targets with `rustc --print target-list`.

[1] https://www.rustup.rs/




Yeah, I didn't mention it in the post because rustup is still in beta. Once it's officially ready to go, trust me, I will start talking about it a lot :)


I wonder if in the long run it will be possible to generate an Android APK without having the Android NDK/SDK installed. Since it could link against the Android's stdlib.

Though, I guess Android NDK uses a custom toolchain, linker, so it might not be that easily achieveable. Though it will give Rust an advantage over other newcomers. Crosscompilation for multiple OS'es/Architecture seems like a big selling point.



Yep. That's exactly what I was thinking about. Rust just keeps getting better and better.


This is definitely going to be big for enabling cross compiling. I've been fighting to get things working sanely. Is there any info on how one would build a new stdlib/corelib for a target? I'm actually anxious to see how much it might help to be able to use Rust on small ARM processors.


We don't have great docs on it yet. https://github.com/japaric/rust-cross is some info. Once we have stuff all in place exactly as we want it, I will be working on good docs to make it much easier for people, but it's still a bit wild-west at the moment.


Good to know that docs will be forthcoming. that link is where i've been working from, and it will usually work but sometimes when i'm upgrading rust it'll just magically not work and i've never figured out why, hence the wild west as you put it. It's definitely looking more and more awesome to be able to get that stuff working.


Are official rustc and cargo releases to be expected for running natively on the tier2 platforms (e.g. official rustc for Linux on ARMv7 that targets Linux on ARMv7)?


Exact platform support, including "cross compile only" or "rustc/cargo runs on it" are listed here: https://doc.rust-lang.org/book/getting-started.html#platform...


It's probably not out of the question, though are there a lot of people out there who want to actually develop on e.g. Android rather than just targeting it?


My laptop is armv7 linux, and not being able to run rustc on it has been annoying. Well, I did find some binary of some old version somewhere, but it's of limited usefulness since it's old, and it didn't come with cargo, which also wants to bootstrap itself from a native binary. The last time I tried it, I couldn't even cross-compile an ARM rustc from x86_64, because the build scripts wanted to run the binary they were building. This is literally the only reason I've been using C and not Rust (which would have been a much more suitable language) for my latest project.

EDIT: Huh. I guess they do have binaries for arm linux now, at least for nightly and beta versions, as of literally two days ago.


Maybe not on Android but on GNU/Linux on something other than x86/x86_64 sure.


Having just acquired a pixel c tablet, I am increasingly looking forward to being able to iterate on my rust projects while being highly mobile. I don't see it as a primary development platform in the near future, but absolutely invaluable as an auxiliary one.


The last time I checked android compiling looked very complicated, tons of steps, tool chain setup for Windows. I hope one day it's as simple as flagging the build for the specified architecture.


Looks cool. Will it support targeting Windows from Linux and vice versa?


rustc/cargo support any target for which a Rust stdlib is distributed, but you are left on your own to install and manage other software which will be needed to do the compilation such as a C cross-compiler for the target, etc. This is much more troublesome for some combinations of host/target than others. Personally, I have yet to get OS X --> Linux working, but Linux/glibc --> Linux/musl was pretty easy.




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: