wzp-relay --version prints "wzp-relay <short-git-hash>". Build hash also logged on startup: version=abc1234. Enables verifying deployed relay matches expected build. Also fixed federation-test.sh: use kill -INT (not SIGTERM) so clients save recordings before exit. Added save delay. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
19 lines
477 B
Rust
19 lines
477 B
Rust
use std::process::Command;
|
|
|
|
fn main() {
|
|
// Get git hash at build time
|
|
let output = Command::new("git")
|
|
.args(["rev-parse", "--short", "HEAD"])
|
|
.output();
|
|
|
|
let hash = match output {
|
|
Ok(o) if o.status.success() => {
|
|
String::from_utf8_lossy(&o.stdout).trim().to_string()
|
|
}
|
|
_ => "unknown".to_string(),
|
|
};
|
|
|
|
println!("cargo:rustc-env=WZP_BUILD_HASH={hash}");
|
|
println!("cargo:rerun-if-changed=.git/HEAD");
|
|
}
|