| ... | ... | @@ -5629,7 +5629,7 @@ fn cmdBuild( |
| 5629 | 5629 | break :cp .{ |
| 5630 | 5630 | .{ |
| 5631 | 5631 | .root_dir = dirs.local_cache, |
| 5632 | | .sub_path = try std.fmt.allocPrint(arena, "o/{s}", .{&digest}), |
| 5632 | .sub_path = try std.fmt.allocPrint(arena, "c/{s}", .{&digest}), |
| 5633 | 5633 | }, |
| 5634 | 5634 | false, |
| 5635 | 5635 | }; |
| ... | ... | @@ -5723,7 +5723,7 @@ fn cmdBuild( |
| 5723 | 5723 | const digest = config_man.final(); |
| 5724 | 5724 | const final_path: Path = .{ |
| 5725 | 5725 | .root_dir = dirs.local_cache, |
| 5726 | | .sub_path = try std.fmt.allocPrint(arena, "o/{s}", .{&digest}), |
| 5726 | .sub_path = try std.fmt.allocPrint(arena, "c/{s}", .{&digest}), |
| 5727 | 5727 | }; |
| 5728 | 5728 | Io.Dir.rename( |
| 5729 | 5729 | config_tmp_path.root_dir.handle, |
| ... | ... | @@ -5731,9 +5731,24 @@ fn cmdBuild( |
| 5731 | 5731 | final_path.root_dir.handle, |
| 5732 | 5732 | final_path.sub_path, |
| 5733 | 5733 | io, |
| 5734 | | ) catch |err| { |
| 5734 | ) catch |err| retry: { |
| 5735 | const e = switch (err) { |
| 5736 | error.FileNotFound => e: { |
| 5737 | const dir_path = final_path.dirname().?; |
| 5738 | dir_path.root_dir.handle.createDirPath(io, dir_path.sub_path) catch |e| |
| 5739 | fatal("failed to create directory {f}: {t}", .{ dir_path, e }); |
| 5740 | if (Io.Dir.rename( |
| 5741 | config_tmp_path.root_dir.handle, |
| 5742 | config_tmp_path.sub_path, |
| 5743 | final_path.root_dir.handle, |
| 5744 | final_path.sub_path, |
| 5745 | io, |
| 5746 | )) |_| break :retry else |e| break :e e; |
| 5747 | }, |
| 5748 | else => |e| e, |
| 5749 | }; |
| 5735 | 5750 | fatal("failed to rename configuration file from {f} into {f}: {t}", .{ |
| 5736 | | config_tmp_path, final_path, err, |
| 5751 | config_tmp_path, final_path, e, |
| 5737 | 5752 | }); |
| 5738 | 5753 | }; |
| 5739 | 5754 | config_man.writeManifest() catch |err| warn("failed to write cache manifest: {t}", .{err}); |