From ecbb27100bfbcc7773ce17312ae17d3775a96c23 Mon Sep 17 00:00:00 2001 From: dogdogdog Date: Thu, 8 Jun 2023 19:57:53 -0700 Subject: use python3 uuid --- build.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build.rs b/build.rs index bc40185..9da3e2d 100644 --- a/build.rs +++ b/build.rs @@ -7,7 +7,15 @@ use std::{ }; fn uuid() -> Result> { - let proc = Command::new("uuidgen").stdout(Stdio::piped()).output()?; + #[cfg(target_family = "windows")] + let py = "python.exe"; + #[cfg(target_family = "unix")] + let py = "python3"; + let proc = Command::new(py) + .arg("-c") + .arg("import uuid; print(uuid.uuid4())") + .stdout(Stdio::piped()) + .output()?; assert!(proc.status.success()); let uuid = String::from_utf8(proc.stdout)?.trim().into(); Ok(uuid) -- cgit v1.2.3