Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rustup, Cargo and Cross-compiling in Rust

Rustup, Cargo and Cross-compiling in Rust

These are slides for a hands-on presentation demonstrating the tooling around the Rust programming language at present. They cover rustup, cargo and theoretical aspects of cross-compiling programs in Rust.

These slides were presented at the Rust Meetup Bangalore - July 2016 hosted at Red Hat Bangalore.

Cc59f0deef3e3d0598ca2ea8e5193dbd?s=128

Kaustav Das Modak

July 02, 2016
Tweet

Transcript

  1. Rustup, Cargo and Cross-compiling Rust programs Kaustav Das Modak |

    @kaustavdm
  2. https://rustup.rs Toolchain manager for Rust

  3. $ rustup toolchain install nightly $ rustup toolchain list Install

    multiple rustc
  4. $ rustup run nightly rustc hello.rs $ rustup run stable

    rustc hello.rs Compile with multiple rustc versions
  5. $ rustup target list $ rustup target add <triple> Add

    other compile targets
  6. $ rustup update $ rustup update nightly Keep updated

  7. $ curl https://sh.rustup.rs -sSf | sh Install rustup and play

    around
  8. $ cargo Manage dependencies & builds

  9. $ cargo new hello --bin Create a new cargo project

  10. $ cargo build $ cargo run Build (run) the project

  11. $ cargo install <crate> Install from crates.io

  12. $ cargo build Dependencies are fetched and built

  13. $ cargo build Dependencies are fetched and built

  14. Cross-compiling add rustc target install proper linker tell cargo about

    the linker cargo build --target=<target>
  15. Thanks!