Rustup Aims to Make Cross-Compiling Rust Much Easier

Rustup, introduced with Rust 1.8, is a toolchain manager for Rust that aims to make it much easier to cross-compile Rust code. Mozilla engineer Brian Anderson has recently shared more details about it.

Rustup is a command-line application that is able to download and switch between different versions of the Rust toolchain –i.e., its compiler, rustc, and the standard library– for a number of supported platforms. In fact, rustc itself is available on about 56 platforms, while rustup can actually manage compilers for 14 of them and standard libraries for 30.

Additionally, rustup can track specific versions of the toolchain, including Rust’s nightly, beta, and releases channels. By way of example, you can use rustup to check how your program behaves on the next Rust release. To do so, you need install the Rust beta toolchain for your current platform and then run your unit tests with it. Using rustup this can be accomplished by executing:

$ rustup install beta
$ rustup run beta cargo test

As another example, Anderson describes how you can use rustup to create static binaries for Linux that use the musl standard library instead of the usual glibc:

rustup is still very much a work in progress, as it strives to extend the number of platforms it supports. In particular, rustup is not yet able to seamlessly cross-compile for Android. Indeed, this requires manually downloading the Android NDK and creating a “standalone toolchain” for it. This will be fixed in a future version of rustup, Anderson says, that will extend its capabilities to also acquiring and configuring the required linker and C toolchain. Furthermore, rustup also aims to target the Web through Emscripten.

rustup is the successor to Anderson’s multirust and supersedes it. rustup is still considered beta, but it can be readily installed and tried out.

InfoQ Weekly Newsletter

Join a community of over 250 K senior developers by signing up for our newsletter. If you are based in the EEA, please contact us so we can provide you with the protections afforded to you under EEA protection laws.

Is your profile up-to-date? Please take a moment to review and update.

Email Address

Note: If updating/changing your email, a validation request will be sent

Company name:

Keep current company name

Update Company name to:

Company role:

Keep current company role

Update company role to:

Company size:

Keep current company Size

Update company size to:

Country/Zone:

Keep current country/zone

Update country/zone to:

State/Province/Region:

Keep current state/province/region

Update state/province/region to:

Subscribe to our newsletter?

Subscribe to our architect newsletter?

Subscribe to our industry email notices?

By subscribing to this email, we may send you content based on your previous topic interests. See our privacy notice for details.

You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.

We notice you're using an ad blocker

We understand why you use ad blockers. However to keep InfoQ free we need your support. InfoQ will not provide your data to third parties without individual opt-in consent. We only work with advertisers relevant to our readers. Please consider whitelisting us.