authorgravatar for leroycepearson@geemili.xyzLeRoyce Pearson <leroycepearson@geemili.xyz> 2020-04-30 20:00:26-06:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-25 13:48:43-04:00
log5a1c6a362743882ba2923570c24f77f555a39504
tree0a586ed1bf9dd632c4fa821c6eaeb5349a056dce
parentbe69e8e871d26973c644cfad5225ae9e337179c9

Set manifest's maximum size to Andrew's recommendation


1 files changed, 3 insertions(+), 2 deletions(-)

lib/std/cache_hash.zig+3-2
......@@ -15,6 +15,8 @@ const base64_decoder = fs.base64_decoder;
1515const BIN_DIGEST_LEN = 48;
1616const BASE64_DIGEST_LEN = base64.Base64Encoder.calcSize(BIN_DIGEST_LEN);
1717
18const MANIFEST_FILE_SIZE_MAX = 50 * 1024 * 1024;
19
1820pub const File = struct {
1921 path: ?[]const u8,
2022 stat: fs.File.Stat,
......@@ -150,8 +152,7 @@ pub const CacheHash = struct {
150152 };
151153 }
152154
153 // TODO: Figure out a good max value?
154 const file_contents = try self.manifest_file.?.inStream().readAllAlloc(self.alloc, 16 * 1024);
155 const file_contents = try self.manifest_file.?.inStream().readAllAlloc(self.alloc, MANIFEST_FILE_SIZE_MAX);
155156 defer self.alloc.free(file_contents);
156157
157158 const input_file_count = self.files.items.len;