summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build.rs10
1 files changed, 9 insertions, 1 deletions
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<String, Box<dyn Error>> {
- 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)