mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-11-05 11:31:14 +00:00
9e6301be70
Some crates don't need it at all. Some crates are using it for a simple functionality which can be replaced easily. Signed-off-by: Wei Liu <liuwe@microsoft.com> This was causing issues with the release build process but we now have a fix to clean residual build assets. Signed-off-by: Rob Bradford <robert.bradford@intel.com>
25 lines
812 B
Rust
25 lines
812 B
Rust
// Copyright © 2020 Intel Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
use std::process::Command;
|
|
|
|
fn main() {
|
|
let mut git_human_readable = "v".to_owned() + env!("CARGO_PKG_VERSION");
|
|
|
|
if let Ok(git_out) = Command::new("git").args(["describe", "--dirty"]).output() {
|
|
if git_out.status.success() {
|
|
if let Ok(git_out_str) = String::from_utf8(git_out.stdout) {
|
|
git_human_readable = git_out_str;
|
|
}
|
|
}
|
|
}
|
|
|
|
// This println!() has a special behavior, as it will set the environment
|
|
// variable GIT_HUMAN_READABLE, so that it can be reused from the binary.
|
|
// Particularly, this is used from the main.rs to display the exact
|
|
// version information.
|
|
println!("cargo:rustc-env=GIT_HUMAN_READABLE={git_human_readable}");
|
|
}
|