summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordogdogdog <hao@graveflex.com>2023-06-08 19:57:53 -0700
committerdogdogdog <hao@graveflex.com>2023-06-08 19:57:59 -0700
commitecbb27100bfbcc7773ce17312ae17d3775a96c23 (patch)
tree5c557446f4553690cc91822a84837b7c9bf73dea
parent5d73b0b40e8f06805faebc3d983d9f3500b66e19 (diff)
use python3 uuidv0.4.23
-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)