skerkour/kerkour.com

`cross` for cross-compiling Rust

linuskmr opened this issue · 1 comments

I came across your blog post "Reproducible cross-compilation for Rust (with Docker)" via This Week in Rust #410 and want to say that your Dockerfiles are really cool.

However, there is already a way to cross-compile Rust via Docker. The tool is called cross and is maintained by the Rust Embedded devices Working Group.

So after installing cross via cargo install cross, you can compile to:

Windows:

cargo build --target x86_64-pc-windows-gnu

aarch64 / ARMv8:

cargo build --target aarch64-unknown-linux-gnu

ARMv7:

cargo build --target armv7-unknown-linux-gnueabihf

As said, your Dockerfiles are really awesome and doing something by yourself is always a worthwhile experience, however I just want to point out to you that there is already a way to cross-compile.

Thank you very much!

I knew cross but I missed the support for windows, which was, in my case, the most important (with aarch64).

I've updated the post to redirect people to it :)