diff options
-rw-r--r-- | crates/rust-analyzer/build.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/rust-analyzer/build.rs b/crates/rust-analyzer/build.rs index d4b010c04..5ae76ba30 100644 --- a/crates/rust-analyzer/build.rs +++ b/crates/rust-analyzer/build.rs | |||
@@ -5,11 +5,14 @@ use std::{env, path::PathBuf, process::Command}; | |||
5 | fn main() { | 5 | fn main() { |
6 | set_rerun(); | 6 | set_rerun(); |
7 | 7 | ||
8 | let rev = rev().unwrap_or_else(|| "???????".to_string()); | 8 | let rev = |
9 | env::var("RUST_ANALYZER_REV").ok().or_else(rev).unwrap_or_else(|| "???????".to_string()); | ||
9 | println!("cargo:rustc-env=REV={}", rev) | 10 | println!("cargo:rustc-env=REV={}", rev) |
10 | } | 11 | } |
11 | 12 | ||
12 | fn set_rerun() { | 13 | fn set_rerun() { |
14 | println!("cargo:rerun-if-env-changed=RUST_ANALYZER_REV"); | ||
15 | |||
13 | let mut manifest_dir = PathBuf::from( | 16 | let mut manifest_dir = PathBuf::from( |
14 | env::var("CARGO_MANIFEST_DIR").expect("`CARGO_MANIFEST_DIR` is always set by cargo."), | 17 | env::var("CARGO_MANIFEST_DIR").expect("`CARGO_MANIFEST_DIR` is always set by cargo."), |
15 | ); | 18 | ); |