| ... | @@ -13,6 +13,7 @@ const mem = std.mem; | ... | @@ -13,6 +13,7 @@ const mem = std.mem; |
| 13 | const fmt = std.fmt; | 13 | const fmt = std.fmt; |
| 14 | const Allocator = std.mem.Allocator; | 14 | const Allocator = std.mem.Allocator; |
| 15 | const Compilation = @import("Compilation.zig"); | 15 | const Compilation = @import("Compilation.zig"); |
| | 16 | const log = std.log.scoped(.cache); |
| 16 | | 17 | |
| 17 | /// Be sure to call `Manifest.deinit` after successful initialization. | 18 | /// Be sure to call `Manifest.deinit` after successful initialization. |
| 18 | pub fn obtain(cache: *const Cache) Manifest { | 19 | pub fn obtain(cache: *const Cache) Manifest { |
| ... | @@ -478,6 +479,7 @@ pub const Manifest = struct { | ... | @@ -478,6 +479,7 @@ pub const Manifest = struct { |
| 478 | } | 479 | } |
| 479 | | 480 | |
| 480 | fn populateFileHash(self: *Manifest, ch_file: *File) !void { | 481 | fn populateFileHash(self: *Manifest, ch_file: *File) !void { |
| | 482 | log.debug("populateFileHash {s}", .{ch_file.path.?}); |
| 481 | const file = try fs.cwd().openFile(ch_file.path.?, .{}); | 483 | const file = try fs.cwd().openFile(ch_file.path.?, .{}); |
| 482 | defer file.close(); | 484 | defer file.close(); |
| 483 | | 485 | |
| ... | @@ -581,7 +583,7 @@ pub const Manifest = struct { | ... | @@ -581,7 +583,7 @@ pub const Manifest = struct { |
| 581 | .target, .target_must_resolve, .prereq => {}, | 583 | .target, .target_must_resolve, .prereq => {}, |
| 582 | else => |err| { | 584 | else => |err| { |
| 583 | try err.printError(error_buf.writer()); | 585 | try err.printError(error_buf.writer()); |
| 584 | std.log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items }); | 586 | log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items }); |
| 585 | return error.InvalidDepFile; | 587 | return error.InvalidDepFile; |
| 586 | }, | 588 | }, |
| 587 | } | 589 | } |
| ... | @@ -593,7 +595,7 @@ pub const Manifest = struct { | ... | @@ -593,7 +595,7 @@ pub const Manifest = struct { |
| 593 | .prereq => |bytes| try self.addFilePost(bytes), | 595 | .prereq => |bytes| try self.addFilePost(bytes), |
| 594 | else => |err| { | 596 | else => |err| { |
| 595 | try err.printError(error_buf.writer()); | 597 | try err.printError(error_buf.writer()); |
| 596 | std.log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items }); | 598 | log.err("failed parsing {s}: {s}", .{ dep_file_basename, error_buf.items }); |
| 597 | return error.InvalidDepFile; | 599 | return error.InvalidDepFile; |
| 598 | }, | 600 | }, |
| 599 | } | 601 | } |