From d7efa1893c9fc2f2d37a361e89aa0a976d7352e5 Mon Sep 17 00:00:00 2001 From: Christian Maniewski Date: Wed, 1 Jul 2020 17:23:13 +0200 Subject: [PATCH] Set `maxBuffer` to avoid ENOBUFS error message See https://github.com/nodejs/node/pull/23027 and https://github.com/trufflesuite/truffle/commit/180359b3fc386ce112cc77e63628d2558e4abb08 --- .../compilerSupplier/loadingStrategies/Docker.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/compile-solidity/compilerSupplier/loadingStrategies/Docker.js b/packages/compile-solidity/compilerSupplier/loadingStrategies/Docker.js index 5b7ef6a7217..990fb184c14 100644 --- a/packages/compile-solidity/compilerSupplier/loadingStrategies/Docker.js +++ b/packages/compile-solidity/compilerSupplier/loadingStrategies/Docker.js @@ -6,6 +6,10 @@ const semver = require("semver"); const LoadingStrategy = require("./LoadingStrategy"); const VersionRange = require("./VersionRange"); +// Set a sensible limit for maxBuffer +// See https://github.com/nodejs/node/pull/23027 +const maxBuffer = 1024 * 1024 * 10; + class Docker extends LoadingStrategy { async load() { const versionString = await this.validateAndGetSolcVersion(); @@ -16,7 +20,7 @@ class Docker extends LoadingStrategy { try { return { - compile: options => String(execSync(command, { input: options })), + compile: options => String(execSync(command, { input: options, maxBuffer })), version: () => versionString }; } catch (error) {