Skip to content

Commit

Permalink
Create a dummy .git file so that our VERSION is used
Browse files Browse the repository at this point in the history
Fixes #76

Signed-off-by: Rafael Ávila de Espíndola <[email protected]>
  • Loading branch information
espindola committed Mar 28, 2024
1 parent 8029693 commit a743c3e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions jemalloc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,17 @@ fn main() {
.expect("failed to copy config file to OUT_DIR");
}

// Create a dummy .git file so that 'git describe' fails and
// configure uses the VERSION file we provide.
if let Err(e) = fs::File::create(build_dir.join(".git")) {
// Assume that, if .git is a directory, it is valid and
// configure will do the right thing.
// std::io::ErrorKind::IsADirectory is unstable :-(
if e.kind().to_string() != "is a directory" {
panic!("failed to create a dummy .git file: {}", e);
}
}

// Run configure:
let configure = build_dir.join("configure");
let mut cmd = Command::new("sh");
Expand Down

0 comments on commit a743c3e

Please sign in to comment.