ok/jj
1
0
Fork 0
forked from mirrors/jj

build: in cli build script, fix relative path to root

Since the recent move of `builds.rs` to `cli/build.rs`, incremental
builds re-calcuate the version number and thus result in some
re-compilation and lots of re-linking.
This commit is contained in:
Martin von Zweigbergk 2023-08-04 23:10:27 -07:00 committed by Martin von Zweigbergk
parent 0075174308
commit aae14b24e0

View file

@ -55,14 +55,14 @@ fn get_git_hash() -> Option<String> {
.output()
{
if output.status.success() {
println!("cargo:rerun-if-changed=.jj/repo/op_heads/heads/");
println!("cargo:rerun-if-changed=../.jj/repo/op_heads/heads/");
return Some(String::from_utf8(output.stdout).unwrap());
}
}
if let Ok(output) = Command::new("git").args(["rev-parse", "HEAD"]).output() {
if output.status.success() {
println!("cargo:rerun-if-changed=.git/HEAD");
println!("cargo:rerun-if-changed=../.git/HEAD");
let line = str::from_utf8(&output.stdout).unwrap();
return Some(line.trim_end().to_owned());
}