We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fda67bd commit 1896a08Copy full SHA for 1896a08
crates/nu-cmd-lang/build.rs
@@ -3,7 +3,12 @@ use std::process::Command;
3
fn main() {
4
// Look up the current Git commit ourselves instead of relying on shadow_rs,
5
// because shadow_rs does it in a really slow-to-compile way (it builds libgit2)
6
- let hash = get_git_hash().unwrap_or_default();
+ // Allow overriding it with `NU_COMMIT_HASH` from outside, such as with nix.
7
+ let hash = get_git_hash().unwrap_or(
8
+ option_env!("NU_COMMIT_HASH")
9
+ .unwrap_or_default()
10
+ .to_string(),
11
+ );
12
println!("cargo:rustc-env=NU_COMMIT_HASH={hash}");
13
shadow_rs::ShadowBuilder::builder()
14
.build()
0 commit comments