Make git dependencies faster + further optimize bun install (#15771)

This commit is contained in:
Jarred Sumner
2024-12-14 19:42:23 -08:00
committed by GitHub
parent 5326a998c7
commit 3ce6ffa6be
5 changed files with 86 additions and 48 deletions

View File

@@ -82,7 +82,7 @@ pub const OS = struct {
if (std.fs.openFileAbsolute("/proc/stat", .{})) |file| {
defer file.close();
const read = try bun.sys.File.from(file).readToEndWithArrayList(&file_buf).unwrap();
const read = try bun.sys.File.from(file).readToEndWithArrayList(&file_buf, true).unwrap();
defer file_buf.clearRetainingCapacity();
const contents = file_buf.items[0..read];
@@ -124,7 +124,7 @@ pub const OS = struct {
if (std.fs.openFileAbsolute("/proc/cpuinfo", .{})) |file| {
defer file.close();
const read = try bun.sys.File.from(file).readToEndWithArrayList(&file_buf).unwrap();
const read = try bun.sys.File.from(file).readToEndWithArrayList(&file_buf, true).unwrap();
defer file_buf.clearRetainingCapacity();
const contents = file_buf.items[0..read];
@@ -175,7 +175,7 @@ pub const OS = struct {
if (std.fs.openFileAbsolute(path, .{})) |file| {
defer file.close();
const read = try bun.sys.File.from(file).readToEndWithArrayList(&file_buf).unwrap();
const read = try bun.sys.File.from(file).readToEndWithArrayList(&file_buf, true).unwrap();
defer file_buf.clearRetainingCapacity();
const contents = file_buf.items[0..read];