| ... | ... | @@ -672,12 +672,21 @@ pub const File = struct { |
| 672 | 672 | // is not needed we can refactor this into having the frontend do the rename |
| 673 | 673 | // directly, and remove this function from link.zig. |
| 674 | 674 | _ = base; |
| 675 | | try std.fs.rename( |
| 676 | | cache_directory.handle, |
| 677 | | tmp_dir_sub_path, |
| 678 | | cache_directory.handle, |
| 679 | | o_sub_path, |
| 680 | | ); |
| 675 | while (true) { |
| 676 | std.fs.rename( |
| 677 | cache_directory.handle, |
| 678 | tmp_dir_sub_path, |
| 679 | cache_directory.handle, |
| 680 | o_sub_path, |
| 681 | ) catch |err| switch (err) { |
| 682 | error.PathAlreadyExists => { |
| 683 | try cache_directory.handle.deleteTree(o_sub_path); |
| 684 | continue; |
| 685 | }, |
| 686 | else => |e| return e, |
| 687 | }; |
| 688 | break; |
| 689 | } |
| 681 | 690 | } |
| 682 | 691 | |
| 683 | 692 | pub fn linkAsArchive(base: *File, comp: *Compilation) !void { |