mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-06-13 18:51:05 +00:00
fix the commit sha in the version (#129)
Signed-off-by: xermicus <cyrill@parity.io>
This commit is contained in:
@@ -48,6 +48,9 @@ mimalloc = { version = "*", default-features = false }
|
||||
libc = { workspace = true }
|
||||
inkwell = { workspace = true, features = ["target-riscv", "llvm18-0-no-llvm-linking"]}
|
||||
|
||||
[build-dependencies]
|
||||
git2 = { workspace = true }
|
||||
|
||||
[features]
|
||||
parallel = ["rayon"]
|
||||
default = ["parallel"]
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
fn main() {
|
||||
let git_rev = std::process::Command::new("git")
|
||||
.args(["rev-parse", "--short", "HEAD"])
|
||||
.output()
|
||||
.map(|out| String::from_utf8(out.stdout).unwrap_or_default())
|
||||
.unwrap_or("unknown".to_owned());
|
||||
|
||||
println!("cargo:rustc-env=GIT_COMMIT_HASH={}", git_rev.trim());
|
||||
let repo = git2::Repository::open("../..").expect("should be a repository");
|
||||
let head = repo.head().expect("should have head");
|
||||
let commit = head.peel_to_commit().expect("should have commit");
|
||||
let id = &commit.id().to_string()[..7];
|
||||
println!("cargo:rustc-env=GIT_COMMIT_HASH={id}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user