21 lines
740 B
Rust
21 lines
740 B
Rust
// Every workspace crate uses the same resolver, including direct Cargo builds.
|
|
use std::{env, path::PathBuf, process::Command};
|
|
fn main() {
|
|
let manifest = PathBuf::from(env::var_os("CARGO_MANIFEST_DIR").unwrap());
|
|
let root = manifest.parent().unwrap().parent().unwrap();
|
|
let output = Command::new("python3")
|
|
.arg(root.join("tools/version"))
|
|
.arg("--cargo")
|
|
.output()
|
|
.expect("Python 3 is required to resolve the FDS build version");
|
|
assert!(
|
|
output.status.success(),
|
|
"FDS version discovery failed: {}",
|
|
String::from_utf8_lossy(&output.stderr)
|
|
);
|
|
print!(
|
|
"{}",
|
|
String::from_utf8(output.stdout).expect("Version metadata must be UTF-8")
|
|
);
|
|
}
|