diff options
author | dogdogdog <hao@graveflex.com> | 2023-06-08 19:57:53 -0700 |
---|---|---|
committer | dogdogdog <hao@graveflex.com> | 2023-06-08 19:57:59 -0700 |
commit | ecbb27100bfbcc7773ce17312ae17d3775a96c23 (patch) | |
tree | 5c557446f4553690cc91822a84837b7c9bf73dea | |
parent | 5d73b0b40e8f06805faebc3d983d9f3500b66e19 (diff) |
use python3 uuidv0.4.23
-rw-r--r-- | build.rs | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -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) |