| ... | @@ -1033,8 +1033,8 @@ fn make(step: *Step, options: Step.MakeOptions) !void { | ... | @@ -1033,8 +1033,8 @@ fn make(step: *Step, options: Step.MakeOptions) !void { |
| 1033 | if (any_output) { | 1033 | if (any_output) { |
| 1034 | const o_sub_path = "o" ++ Dir.path.sep_str ++ &digest; | 1034 | const o_sub_path = "o" ++ Dir.path.sep_str ++ &digest; |
| 1035 | | 1035 | |
| 1036 | b.cache_root.handle.rename(tmp_dir_path, b.cache_root.handle, o_sub_path, io) catch |err| { | 1036 | b.cache_root.handle.rename(tmp_dir_path, b.cache_root.handle, o_sub_path, io) catch |err| switch (err) { |
| 1037 | if (err == error.PathAlreadyExists) { | 1037 | Dir.RenameError.DirNotEmpty => { |
| 1038 | b.cache_root.handle.deleteTree(io, o_sub_path) catch |del_err| { | 1038 | b.cache_root.handle.deleteTree(io, o_sub_path) catch |del_err| { |
| 1039 | return step.fail("unable to remove dir '{f}'{s}: {t}", .{ | 1039 | return step.fail("unable to remove dir '{f}'{s}: {t}", .{ |
| 1040 | b.cache_root, tmp_dir_path, del_err, | 1040 | b.cache_root, tmp_dir_path, del_err, |
| ... | @@ -1045,11 +1045,10 @@ fn make(step: *Step, options: Step.MakeOptions) !void { | ... | @@ -1045,11 +1045,10 @@ fn make(step: *Step, options: Step.MakeOptions) !void { |
| 1045 | b.cache_root, tmp_dir_path, b.cache_root, o_sub_path, retry_err, | 1045 | b.cache_root, tmp_dir_path, b.cache_root, o_sub_path, retry_err, |
| 1046 | }); | 1046 | }); |
| 1047 | }; | 1047 | }; |
| 1048 | } else { | 1048 | }, |
| 1049 | return step.fail("unable to rename dir '{f}{s}' to '{f}{s}': {t}", .{ | 1049 | else => return step.fail("unable to rename dir '{f}{s}' to '{f}{s}': {t}", .{ |
| 1050 | b.cache_root, tmp_dir_path, b.cache_root, o_sub_path, err, | 1050 | b.cache_root, tmp_dir_path, b.cache_root, o_sub_path, err, |
| 1051 | }); | 1051 | }), |
| 1052 | } | | |
| 1053 | }; | 1052 | }; |
| 1054 | } | 1053 | } |
| 1055 | | 1054 | |