Skip to content

Commit

Permalink
fix: concurrent downloads again (pykeio#323)
Browse files Browse the repository at this point in the history
(cherry picked from commit f90a3b6)
  • Loading branch information
qryxip committed Nov 24, 2024
1 parent 1f9d28e commit f4db652
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ort-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,13 +453,14 @@ fn prepare_libort_dir() -> (PathBuf, bool) {
}
extract_tgz(&downloaded_file, &temp_extract_dir);
if should_rename {
match std::fs::rename(&temp_extract_dir, bin_extract_dir) {
match std::fs::rename(&temp_extract_dir, &bin_extract_dir) {
Ok(()) => {}
Err(e) => match e.kind() {
io::ErrorKind::AlreadyExists => {
Err(e) => {
if bin_extract_dir.exists() {
let _ = fs::remove_dir_all(temp_extract_dir);
} else {
panic!("failed to extract downloaded binaries: {e}");
}
_ => panic!("failed to extract downloaded binaries: {e}")
}
}
}
Expand Down

0 comments on commit f4db652

Please sign in to comment.