After running buidler coverage the process fails with InternalCompilerError: Metadata too large.. Already tried node --max-old-space-size=4096 ./node_modules/.bin/buidler coverage which yields the same error. Running sol-coverage via truffle works when prefixing node --max-old-space-size=4096.
yarn run v1.16.0
$ node --max-old-space-size=4096 ./node_modules/.bin/buidler coverage
> server: http://127.0.0.1:8555
> ganache-core: v2.10.1
> solidity-coverage: v0.7.4
Network Info
============
> port: 8555
> network: soliditycoverage
Instrumenting for coverage...
=============================
> Core/ACTUSTypes.sol
> Core/Conventions/BusinessDayConvention.sol
> Core/Conventions/ContractDefaultConvention.sol
> Core/Conventions/ContractRoleConvention.sol
> Core/Conventions/DayCountConvention.sol
> Core/Conventions/EndOfMonthConvention.sol
> Core/Core.sol
> Core/Schedule.sol
> Core/SignedMath.sol
> Core/Utils.sol
> Engines/ANNEngine.sol
> Engines/BaseEngine.sol
> Engines/CECEngine.sol
> Engines/CEGEngine.sol
> Engines/IEngine.sol
> Engines/PAMEngine.sol
> Engines/POF.sol
> Engines/STF.sol
Coverage skipped for:
=====================
> external/BokkyPooBah/BokkyPooBahsDateTimeLibrary.sol
> Migrations.sol
> test/TestCore.sol
> test/TestPOF.sol
> test/TestSignedMath.sol
> test/TestSTF.sol
Compiling...
Downloading compiler version 0.6.4
InternalCompilerError: Metadata too large.
> solidity-coverage cleaning up, shutting down ganache server
Error BDLR600: Compilation failed
For more info go to https://buidler.dev/BDLR600 or run Buidler with --show-stack-traces
solidity-coverage: 0.7.4
buidler: ^1.3.0
@jo-es This looks like a compiler error that's happening because of a size constraint at Solidity here
If you have a chance, could you see what happens if you go into your copy of buidler in node_modules and modify the compiler settings at this line so that useLiteralContent is false? e.g
settings: {
metadata: {
- useLiteralContent: true
+ useLiteralContent: false
},
Do you have a link to the repo & branch which triggers this error (if the project is public)?
Thank you for the quick response. This is the repository: actus-solidity. Running node --max-old-space-size=4096 ./node_modules/.bin/buidler coverage in directory outputs that error.
Changing useLiteralContent to false fixes the problem.
@jo-es
Ok thanks, will need to open an issue / PR at buidler to make that setting configurable.
There's an open PR at buidler 497 that makes useLiteralContent configurable...
in case someone is having this same problem, adding this to your builder config fixes it:
const {TASK_COMPILE_GET_COMPILER_INPUT} = require("@nomiclabs/buidler/builtin-tasks/task-names");
task(TASK_COMPILE_GET_COMPILER_INPUT).setAction(await (_, __, runSuper) => {
const input = await runSuper();
input.settings.metadata.useLiteralContent = false;
return input;
})
Ah, maybe we could just add that here as a default.
Should be fixed in 0.7.7. Thanks @alcuadrado for the solution!