Skip to content

Commit

Permalink
[fix] #2473: parse rustc --version instead of RUSTUP_TOOLCHAIN
Browse files Browse the repository at this point in the history
Signed-off-by: Artemii Gerasimovich <gerasimovich@soramitsu.co.jp>
  • Loading branch information
QuentinI authored Jul 14, 2022
1 parent 63fc176 commit 8c7d9d7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ fn main() {
// invoked with the nightly toolchain. We should not force our
// users to have the `nightly` if we don't use any `nightly`
// features in the actual binary.
if env::var("RUSTUP_TOOLCHAIN")
.expect("Should be defined")
let rustc_version_output = Command::new("rustc")
.arg("--version")
.output()
.expect("Failed to run `rustc --version`");

if std::str::from_utf8(&rustc_version_output.stdout)
.expect("Garbage in `rustc --version` output")
.contains("nightly")
{
let manifest_dir = env::var("CARGO_MANIFEST_DIR")
Expand Down

0 comments on commit 8c7d9d7

Please sign in to comment.