diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/build.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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}; | |||
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 = env::var("RUST_ANALYZER_REV").ok().or_else(rev).unwrap_or_else(|| "???????".to_string()); |
9 | println!("cargo:rustc-env=REV={}", rev) | 9 | println!("cargo:rustc-env=REV={}", rev) |
10 | } | 10 | } |
11 | 11 | ||
12 | fn set_rerun() { | 12 | fn set_rerun() { |
13 | println!("cargo:rerun-if-env-changed=RUST_ANALYZER_REV"); | ||
14 | |||
13 | let mut manifest_dir = PathBuf::from( | 15 | let mut manifest_dir = PathBuf::from( |
14 | env::var("CARGO_MANIFEST_DIR").expect("`CARGO_MANIFEST_DIR` is always set by cargo."), | 16 | env::var("CARGO_MANIFEST_DIR").expect("`CARGO_MANIFEST_DIR` is always set by cargo."), |
15 | ); | 17 | ); |