mirror of
https://github.com/containers/youki
synced 2026-01-01 05:01:42 +01:00
* feat(info): add rustc, spec, and libseccomp version Signed-off-by: nayuta-ai <nayuta723@gmail.com> * fix(build): improve rustc version retrieval and update info command Signed-off-by: nayuta-ai <nayuta723@gmail.com> * style(info): format rustc version output for improved readability Signed-off-by: nayuta-ai <nayuta723@gmail.com> * feat(build): enhance build script to include rustc version and libseccomp version Signed-off-by: nayuta-ai <nayuta723@gmail.com> * docs(info): update print_youki documentation for clarity and compatibility with Moby Signed-off-by: nayuta-ai <nayuta723@gmail.com> --------- Signed-off-by: nayuta-ai <nayuta723@gmail.com>
28 lines
975 B
Rust
28 lines
975 B
Rust
use anyhow::Result;
|
|
use vergen_gitcl::{Emitter, GitclBuilder, RustcBuilder};
|
|
|
|
pub fn main() -> Result<()> {
|
|
if Emitter::default()
|
|
.add_instructions(&GitclBuilder::all_git()?)?
|
|
.add_instructions(&RustcBuilder::all_rustc()?)?
|
|
.emit()
|
|
.is_err()
|
|
{
|
|
// currently we only inject git sha, so just this
|
|
// else we will need to think of more elegant way to check
|
|
// what failed, and what needs to be added
|
|
println!("cargo:rustc-env=VERGEN_GIT_SHA=unknown");
|
|
println!("cargo:rustc-env=VERGEN_RUSTC_SEMVER=unknown");
|
|
}
|
|
|
|
// Embed libseccomp version at build time (only when seccomp feature is enabled)
|
|
if std::env::var("CARGO_FEATURE_SECCOMP").is_ok() {
|
|
let version = pkg_config::probe_library("libseccomp")
|
|
.map(|lib| lib.version)
|
|
.unwrap_or_else(|_| "unknown".to_string());
|
|
println!("cargo:rustc-env=LIBSECCOMP_VERSION={}", version);
|
|
}
|
|
|
|
Ok(())
|
|
}
|