fix(core): prevent max buffer issues with bunlock files (#25985)

Fixes #25978 #25965
This commit is contained in:
Jordan Hall 2024-05-27 18:29:12 +01:00 committed by GitHub
parent 901d17d273
commit ed1f7a68ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -55,7 +55,9 @@ export const createNodes: CreateNodes = [
const lockFileContents = const lockFileContents =
packageManager !== 'bun' packageManager !== 'bun'
? readFileSync(lockFilePath).toString() ? readFileSync(lockFilePath).toString()
: execSync(`bun ${lockFilePath}`).toString(); : execSync(`bun ${lockFilePath}`, {
maxBuffer: 1024 * 1024 * 10,
}).toString();
const lockFileHash = getLockFileHash(lockFileContents); const lockFileHash = getLockFileHash(lockFileContents);
if (!lockFileNeedsReprocessing(lockFileHash)) { if (!lockFileNeedsReprocessing(lockFileHash)) {
@ -98,7 +100,9 @@ export const createDependencies: CreateDependencies = (
const lockFileContents = const lockFileContents =
packageManager !== 'bun' packageManager !== 'bun'
? readFileSync(lockFilePath).toString() ? readFileSync(lockFilePath).toString()
: execSync(`bun ${lockFilePath}`).toString(); : execSync(`bun ${lockFilePath}`, {
maxBuffer: 1024 * 1024 * 10,
}).toString();
const lockFileHash = getLockFileHash(lockFileContents); const lockFileHash = getLockFileHash(lockFileContents);
if (!lockFileNeedsReprocessing(lockFileHash)) { if (!lockFileNeedsReprocessing(lockFileHash)) {