MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / set_commit_info_for_rustc

Function set_commit_info_for_rustc

build.rs:19–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17}
18
19fn set_commit_info_for_rustc() {
20 if !Path::new(".git").exists() {
21 return;
22 }
23 let output = match Command::new("git")
24 .arg("log")
25 .arg("-1")
26 .arg("--date=short")
27 .arg("--format=%H %h %cd")
28 .arg("--abbrev=9")
29 .output()
30 {
31 Ok(output) if output.status.success() => output,
32 _ => return,
33 };
34 let stdout = String::from_utf8(output.stdout).unwrap();
35 let mut parts = stdout.split_whitespace();
36 let mut next = || parts.next().unwrap();
37 println!("cargo:rustc-env=WASMTIME_GIT_HASH={}", next());
38 println!(
39 "cargo:rustc-env=WASMTIME_VERSION_INFO={} ({} {})",
40 env!("CARGO_PKG_VERSION"),
41 next(),
42 next()
43 );
44}

Callers 1

mainFunction · 0.85

Calls 7

existsMethod · 0.80
outputMethod · 0.80
newFunction · 0.50
argMethod · 0.45
successMethod · 0.45
unwrapMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected