Control Rust Version with Rust-ToolChain

my company is working on a big rust project, and this project has a rust-toolchain file which tells rustup which exact nightly version to use. Unfortunately, Travis downloads and install the nightly Rust channel before rustup notices that we really need nightly-2018-08-14 , so Rust is downloaded and installed twice. This is not only a waste of bandwidth, it currently also makes the builds noticeably slower.

I tried fixing this by setting TRAVIS_RUST_VERSION in before_install , but that already seems to be too late.

any idea on how to fix this??

I should mention that inspecting the content of rust-toolchain file is not ideal, since Travis only fetches .travis.yml instructions during the build configuration.

You can set this with rust, which is passed on to --default-toolchain= argument for rustup. For example:

language: rust
rust:
  - nightly-*

So rustc --version yields:

rustc --version
rustc (version)
1 Like

thank you, cant believe it took this long to find! thank u @montana

Glad to hear it.