Skip to content

Commit

Permalink
build: in cli build script, fix relative path to root
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
martinvonz committed Aug 5, 2023
1 parent 0075174 commit aae14b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit aae14b2

Please sign in to comment.