From bed0b794e54c22093ae5f822e9a6adca181112c2 Mon Sep 17 00:00:00 2001 From: oxalica Date: Thu, 18 Jun 2020 20:31:32 +0800 Subject: Allow overriding rust-analyzer display revision --- crates/rust-analyzer/build.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates') diff --git a/crates/rust-analyzer/build.rs b/crates/rust-analyzer/build.rs index d4b010c04..5f2162cba 100644 --- a/crates/rust-analyzer/build.rs +++ b/crates/rust-analyzer/build.rs @@ -5,11 +5,13 @@ use std::{env, path::PathBuf, process::Command}; fn main() { set_rerun(); - let rev = rev().unwrap_or_else(|| "???????".to_string()); + let rev = env::var("RUST_ANALYZER_REV").ok().or_else(rev).unwrap_or_else(|| "???????".to_string()); println!("cargo:rustc-env=REV={}", rev) } fn set_rerun() { + println!("cargo:rerun-if-env-changed=RUST_ANALYZER_REV"); + let mut manifest_dir = PathBuf::from( env::var("CARGO_MANIFEST_DIR").expect("`CARGO_MANIFEST_DIR` is always set by cargo."), ); -- cgit v1.2.3