authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-02-09 10:00:25-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-02-13 06:42:25-07:00
log066632261492ee7624117ad09269f57526aca4c0
tree2a64f68dedcb990e3f6d71407adb501639d32723
parent9cb52ca6ce7043ba0ce08d5650ac542075f10685

std.Build.Cache: remove debug log statements

Now that this API is used by the build system, these debug logs are problematic because build scripts run in debug mode, making these logs noisy output.

1 files changed, 1 insertions(+), 24 deletions(-)

lib/std/Build/Cache.zig+1-24
...@@ -53,7 +53,7 @@ mutex: std.Thread.Mutex = .{},...@@ -53,7 +53,7 @@ mutex: std.Thread.Mutex = .{},
53/// are replaced with single-character indicators. This is not to save53/// are replaced with single-character indicators. This is not to save
54/// space but to eliminate absolute file paths. This improves portability54/// space but to eliminate absolute file paths. This improves portability
55/// and usefulness of the cache for advanced use cases.55/// and usefulness of the cache for advanced use cases.
56prefixes_buffer: [3]Directory = undefined,56prefixes_buffer: [4]Directory = undefined,
57prefixes_len: usize = 0,57prefixes_len: usize = 0,
5858
59pub const DepTokenizer = @import("Cache/DepTokenizer.zig");59pub const DepTokenizer = @import("Cache/DepTokenizer.zig");
...@@ -71,9 +71,6 @@ const Allocator = std.mem.Allocator;...@@ -71,9 +71,6 @@ const Allocator = std.mem.Allocator;
71const log = std.log.scoped(.cache);71const log = std.log.scoped(.cache);
7272
73pub fn addPrefix(cache: *Cache, directory: Directory) void {73pub fn addPrefix(cache: *Cache, directory: Directory) void {
74 if (directory.path) |p| {
75 log.debug("Cache.addPrefix {d} {s}", .{ cache.prefixes_len, p });
76 }
77 cache.prefixes_buffer[cache.prefixes_len] = directory;74 cache.prefixes_buffer[cache.prefixes_len] = directory;
78 cache.prefixes_len += 1;75 cache.prefixes_len += 1;
79}76}
...@@ -120,8 +117,6 @@ fn findPrefixResolved(cache: *const Cache, resolved_path: []u8) !PrefixedPath {...@@ -120,8 +117,6 @@ fn findPrefixResolved(cache: *const Cache, resolved_path: []u8) !PrefixedPath {
120 .prefix = @intCast(u8, i),117 .prefix = @intCast(u8, i),
121 .sub_path = sub_path,118 .sub_path = sub_path,
122 };119 };
123 } else {
124 log.debug("'{s}' does not start with '{s}'", .{ resolved_path, p });
125 }120 }
126 }121 }
127122
...@@ -319,10 +314,6 @@ pub const Manifest = struct {...@@ -319,10 +314,6 @@ pub const Manifest = struct {
319 const prefixed_path = try self.cache.findPrefix(file_path);314 const prefixed_path = try self.cache.findPrefix(file_path);
320 errdefer gpa.free(prefixed_path.sub_path);315 errdefer gpa.free(prefixed_path.sub_path);
321316
322 log.debug("Manifest.addFile {s} -> {d} {s}", .{
323 file_path, prefixed_path.prefix, prefixed_path.sub_path,
324 });
325
326 self.files.addOneAssumeCapacity().* = .{317 self.files.addOneAssumeCapacity().* = .{
327 .prefixed_path = prefixed_path,318 .prefixed_path = prefixed_path,
328 .contents = null,319 .contents = null,
...@@ -687,10 +678,6 @@ pub const Manifest = struct {...@@ -687,10 +678,6 @@ pub const Manifest = struct {
687 const prefixed_path = try self.cache.findPrefix(file_path);678 const prefixed_path = try self.cache.findPrefix(file_path);
688 errdefer gpa.free(prefixed_path.sub_path);679 errdefer gpa.free(prefixed_path.sub_path);
689680
690 log.debug("Manifest.addFilePostFetch {s} -> {d} {s}", .{
691 file_path, prefixed_path.prefix, prefixed_path.sub_path,
692 });
693
694 const new_ch_file = try self.files.addOne(gpa);681 const new_ch_file = try self.files.addOne(gpa);
695 new_ch_file.* = .{682 new_ch_file.* = .{
696 .prefixed_path = prefixed_path,683 .prefixed_path = prefixed_path,
...@@ -717,10 +704,6 @@ pub const Manifest = struct {...@@ -717,10 +704,6 @@ pub const Manifest = struct {
717 const prefixed_path = try self.cache.findPrefix(file_path);704 const prefixed_path = try self.cache.findPrefix(file_path);
718 errdefer gpa.free(prefixed_path.sub_path);705 errdefer gpa.free(prefixed_path.sub_path);
719706
720 log.debug("Manifest.addFilePost {s} -> {d} {s}", .{
721 file_path, prefixed_path.prefix, prefixed_path.sub_path,
722 });
723
724 const new_ch_file = try self.files.addOne(gpa);707 const new_ch_file = try self.files.addOne(gpa);
725 new_ch_file.* = .{708 new_ch_file.* = .{
726 .prefixed_path = prefixed_path,709 .prefixed_path = prefixed_path,
...@@ -748,15 +731,9 @@ pub const Manifest = struct {...@@ -748,15 +731,9 @@ pub const Manifest = struct {
748 const ch_file = try self.files.addOne(gpa);731 const ch_file = try self.files.addOne(gpa);
749 errdefer self.files.shrinkRetainingCapacity(self.files.items.len - 1);732 errdefer self.files.shrinkRetainingCapacity(self.files.items.len - 1);
750733
751 log.debug("Manifest.addFilePostContents resolved_path={s}", .{resolved_path});
752
753 const prefixed_path = try self.cache.findPrefixResolved(resolved_path);734 const prefixed_path = try self.cache.findPrefixResolved(resolved_path);
754 errdefer gpa.free(prefixed_path.sub_path);735 errdefer gpa.free(prefixed_path.sub_path);
755736
756 log.debug("Manifest.addFilePostContents -> {d} {s}", .{
757 prefixed_path.prefix, prefixed_path.sub_path,
758 });
759
760 ch_file.* = .{737 ch_file.* = .{
761 .prefixed_path = prefixed_path,738 .prefixed_path = prefixed_path,
762 .max_file_size = null,739 .max_file_size = null,