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 = .{},
5353/// are replaced with single-character indicators. This is not to save
5454/// space but to eliminate absolute file paths. This improves portability
5555/// and usefulness of the cache for advanced use cases.
56prefixes_buffer: [3]Directory = undefined,
56prefixes_buffer: [4]Directory = undefined,
5757prefixes_len: usize = 0,
5858
5959pub const DepTokenizer = @import("Cache/DepTokenizer.zig");
......@@ -71,9 +71,6 @@ const Allocator = std.mem.Allocator;
7171const log = std.log.scoped(.cache);
7272
7373pub fn addPrefix(cache: *Cache, directory: Directory) void {
74 if (directory.path) |p| {
75 log.debug("Cache.addPrefix {d} {s}", .{ cache.prefixes_len, p });
76 }
7774 cache.prefixes_buffer[cache.prefixes_len] = directory;
7875 cache.prefixes_len += 1;
7976}
......@@ -120,8 +117,6 @@ fn findPrefixResolved(cache: *const Cache, resolved_path: []u8) !PrefixedPath {
120117 .prefix = @intCast(u8, i),
121118 .sub_path = sub_path,
122119 };
123 } else {
124 log.debug("'{s}' does not start with '{s}'", .{ resolved_path, p });
125120 }
126121 }
127122
......@@ -319,10 +314,6 @@ pub const Manifest = struct {
319314 const prefixed_path = try self.cache.findPrefix(file_path);
320315 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
326317 self.files.addOneAssumeCapacity().* = .{
327318 .prefixed_path = prefixed_path,
328319 .contents = null,
......@@ -687,10 +678,6 @@ pub const Manifest = struct {
687678 const prefixed_path = try self.cache.findPrefix(file_path);
688679 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
694681 const new_ch_file = try self.files.addOne(gpa);
695682 new_ch_file.* = .{
696683 .prefixed_path = prefixed_path,
......@@ -717,10 +704,6 @@ pub const Manifest = struct {
717704 const prefixed_path = try self.cache.findPrefix(file_path);
718705 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
724707 const new_ch_file = try self.files.addOne(gpa);
725708 new_ch_file.* = .{
726709 .prefixed_path = prefixed_path,
......@@ -748,15 +731,9 @@ pub const Manifest = struct {
748731 const ch_file = try self.files.addOne(gpa);
749732 errdefer self.files.shrinkRetainingCapacity(self.files.items.len - 1);
750733
751 log.debug("Manifest.addFilePostContents resolved_path={s}", .{resolved_path});
752
753734 const prefixed_path = try self.cache.findPrefixResolved(resolved_path);
754735 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
760737 ch_file.* = .{
761738 .prefixed_path = prefixed_path,
762739 .max_file_size = null,