Skip to content

Commit 4d792cf

Browse files
committed
README: Link to Rocket example, unwrap lines
1 parent 5ef22f2 commit 4d792cf

File tree

1 file changed

+26
-41
lines changed

1 file changed

+26
-41
lines changed

README.md

Lines changed: 26 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,46 @@
1-
This is a Heroku buildpack for Rust with support for [cargo][]
2-
and [rustup][]. Features include:
1+
This is a Heroku buildpack for Rust with support for [cargo][] and [rustup][]. Features include:
32

43
- Caching of builds between deployments.
54
- Automatic updates to the latest stable Rust by default.
65
- Optional pinning of Rust to a specific version.
7-
- Support for `export` so that other buildpacks can access the Rust
8-
toolchain.
9-
- Support for compiling Rust-based extensions for projects written
10-
in other languages.
11-
12-
For an example project, see [rust-buildpack-example-actix][].
6+
- Support for `export` so that other buildpacks can access the Rust toolchain.
7+
- Support for compiling Rust-based extensions for projects written in other languages.
138

149
[fode]: https://github.com/ericfode/heroku-buildpack-rust
1510
[cargo]: http://crates.io/
1611
[rustup]: https://www.rustup.rs/
12+
13+
## Example projects
14+
15+
Here are several example projects:
16+
17+
- [rust-buildpack-example-actix][] uses the popular [Actix][] framework, and runs on stable Rust.
18+
- [rust-buildpack-example-rocket][] uses the innovative [Rocket][] framework, which currently requires nightly Rust.
19+
1720
[rust-buildpack-example-actix]: https://github.com/emk/rust-buildpack-example-actix
21+
[Actix]: https://actix.rs/
22+
[rust-buildpack-example-actix]: https://github.com/emk/rust-buildpack-example-rocket
23+
[Rocket]: https://rocket.rs/
1824

1925
## Using this buildpack
2026

2127
To deploy an application to Heroku, we recommend installing the [Heroku CLI][].
2228

23-
If you're creating a new Heroku application, `cd` to the directory
24-
containing your code, and run:
29+
If you're creating a new Heroku application, `cd` to the directory containing your code, and run:
2530

2631
```sh
2732
heroku create --buildpack emk/rust
2833
```
2934

30-
This will only work if your application has a `Cargo.toml` and uses `git`.
31-
If you want to set a particular name for application, see `heroku create
32-
--help` first.
35+
This will only work if your application has a `Cargo.toml` and uses `git`. If you want to set a particular name for application, see `heroku create --help` first.
3336

3437
To use this as the buildpack for an existing application, run:
3538

3639
```sh
3740
heroku buildpacks:set emk/rust
3841
```
3942

40-
You will also need to create a `Procfile` pointing to the release version of
41-
your application, and commit it to `git`:
43+
You will also need to create a `Procfile` pointing to the release version of your application, and commit it to `git`:
4244

4345
```Procfile
4446
web: ./target/release/hello
@@ -54,9 +56,7 @@ git push heroku master
5456

5557
### Running Diesel migrations during the release phase
5658

57-
This will install the diesel CLI at build time and make it available in your dyno.
58-
Migrations will run whenever a new version of your app is released. Add the
59-
following line to your `RustConfig`
59+
This will install the diesel CLI at build time and make it available in your dyno. Migrations will run whenever a new version of your app is released. Add the following line to your `RustConfig`
6060

6161
```sh
6262
RUST_INSTALL_DIESEL=1
@@ -72,36 +72,23 @@ release: ./target/release/diesel migration run
7272

7373
## Specifying which version of Rust to use
7474

75-
By default, your application will be built using the latest stable Rust.
76-
Normally, this is pretty safe: New stable Rust releases have excellent
77-
backwards compatibility.
75+
By default, your application will be built using the latest stable Rust. Normally, this is pretty safe: New stable Rust releases have excellent backwards compatibility.
7876

79-
But you may wish to use `nightly` Rust or to lock your Rust version to a
80-
known-good configuration for more reproducible builds. To specify a specific
81-
version of the toolchain, use a [`rust-toolchain`](https://github.com/rust-lang-nursery/rustup.rs#the-toolchain-file) file in the format rustup
82-
uses.
77+
But you may wish to use `nightly` Rust or to lock your Rust version to a known-good configuration for more reproducible builds. To specify a specific version of the toolchain, use a [`rust-toolchain`](https://github.com/rust-lang-nursery/rustup.rs#the-toolchain-file) file in the format rustup uses.
8378

84-
Note: if you previously specified a `VERSION` variable in `RustConfig`, that will continue to work,
85-
and will override a `rust-toolchain` file.
79+
Note: if you previously specified a `VERSION` variable in `RustConfig`, that will continue to work, and will override a `rust-toolchain` file.
8680

8781
## Combining with other buildpacks
8882

89-
If you have a project which combines both Rust and another programming
90-
language, you can insert this buildpack before your existing one as
91-
follows:
83+
If you have a project which combines both Rust and another programming language, you can insert this buildpack before your existing one as follows:
9284

9385
```sh
9486
heroku buildpacks:add --index 1 emk/rust
9587
```
9688

97-
If you have a valid `Cargo.toml` in your project, this is all you need to
98-
do. The Rust buildpack will run first, and your existing buildpack will
99-
run second.
89+
If you have a valid `Cargo.toml` in your project, this is all you need to do. The Rust buildpack will run first, and your existing buildpack will run second.
10090

101-
But if you only need Rust to build a particular Ruby gem, and you have no
102-
top-level `Cargo.toml` file, you'll need to let the buildpack know to skip
103-
the build stage. You can do this by adding the following line to
104-
`RustConfig`:
91+
But if you only need Rust to build a particular Ruby gem, and you have no top-level `Cargo.toml` file, you'll need to let the buildpack know to skip the build stage. You can do this by adding the following line to `RustConfig`:
10592

10693
```sh
10794
RUST_SKIP_BUILD=1
@@ -121,8 +108,7 @@ If you need to tweak this buildpack, the following information may help.
121108

122109
### Testing with Docker
123110

124-
To test changes to the buildpack using the included
125-
`docker-compose-test.yml`, run:
111+
To test changes to the buildpack using the included `docker-compose-test.yml`, run:
126112

127113
```sh
128114
./test_buildpack
@@ -134,7 +120,6 @@ Then make sure there are no Rust-related *.so files getting linked:
134120
ldd heroku-rust-cargo-hello/target/release/hello
135121
```
136122

137-
This uses the Docker image `heroku/cedar`, which allows us to test in an
138-
official Cedar-like environment.
123+
This uses the Docker image `heroku/cedar`, which allows us to test in an official Cedar-like environment.
139124

140125
We also run this test automatically on Travis CI.

0 commit comments

Comments
 (0)