by RoxasShadow

GitHub Readme.md


Build Status


  • Cached multirust, Rust toolchain.
  • Caching of previous build artifacts to (potentially dramatically) speed up similar builds.
  • Configurable version selection inside of the Cargo.toml, or by specifying the $RUST_VERSION environment variable.


You can use any override you would pass multirust for this buildpack.

We currently (ab)use the cargo's "target" feature to set the version desired. Unfortunately because of this there are sometimes (harmless) cargo warnings about an unused value in the toml file.


name = "foo"
version = "0.1.0"
authors = ["Andrew Hobden <andrew@hoverbear.org>"]

iron = "*"

version = "nightly"


APP="rust-buildpack-test" && \
cargo new --bin $APP      && \
cd $APP                   && \
git init                  && \
heroku create $APP --buildpack https://github.com/Hoverbear/heroku-buildpack-rust && \
echo "web: target/release/$APP" > Procfile

Example App

After following the instructions above, in Cargo.toml add:

iron = "*"

In src/main.rs let's use a simple iron demo:

extern crate iron;

use iron::prelude::*;
use iron::status;
use std::env;

fn main() {
    fn hello_world(_: &mut Request) -> IronResult<Response> {
        Ok(Response::with((status::Ok, "Hello World!")))

    let url = format!("{}", env::var("PORT").unwrap());

    println!("Binding on {:?}", url);
    println!("Bound on {:?}", url);

Now the following steps:

git add src/main.rs Cargo.toml Procfile && \
git commit -m "Init"                    && \
git push heroku master

Heroku should then build your application. Finally, you may need to start your application's web dyno with:

heroku ps:scale web=1

Now you can visit https://$APP.herokuapp.com/ and see your application!


If you have Docker, you can test this buildpack by doing the following:


The Makefile defines how to pull down the testrunner and build the appropriate docker container, then test the buildpack.