Closed emk closed 6 years ago
In #13, we're discussing the possibility of using heroku config:set RUST_CHANNEL=nightly
instead of putting it in Cargo.toml
, because we need to support the case with no Cargo.toml
.
At this point, we're committed to having some mechanism for specifying configuration via environment variables, thanks to RUST_SKIP_BUILD
in #14. So this issue can probably be put on the back burner until the Cargo and Rustup maintainers come up with a standard way to specify the Rust version.
Rustup now supports a rust-toolchain
file in the project root (see https://github.com/dikaiosune/rust-dashboard/blob/master/rust-toolchain for an example) -- what about reading that for the rustup update/install?
EDIT: it's specified here
This is a great idea, and I would eagerly merge a PR to implement this! However, I don't have time to tackle it myself this week, or probably next.
Right now, we use a
RustConfig
file to specify theVERSION
we want to use. This adds one more unnecessary bit of clutter to a project repo.There's a discussion of this at https://github.com/rust-lang/cargo/issues/1214 (closest) and https://github.com/rust-lang/cargo/issues/837 (upstream tracking issue).
But Cargo has a
[metadata]
section we could use, as shown here. It would be great to add arustup_channel
to this file:We could use
cargo read-manifest
to convert this to JSON on standard output. However, I'm not sure whether Heroku's build envrionment has any good JSON-parsing tools, so this might not actually get us any closer. Would it be reasonable/possible to install a tool likejq
at build time on Heroku to parse the JSON for us, or is this overkill?In theory, Rustup might someday decide to support a standard way of specifying which version of Rust to use with a given project. The tracking bug for this is at https://github.com/rust-lang-nursery/rustup.rs/issues/460.