-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Docker compilation twice as slow, seems to hang on large contract sets. #2005
Comments
Hey @cgewecke , thanks for pointing this out! Since we're still bundling solc-js, it seems like the easy fix is to continue using it for quick import parsing. Will take a look shortly. |
@CruzMolina Yes that seem reasonable. Might need to throw away the nonImportErrors and let the real compilation pick them up? It's a little weird to compile with different solc versions. |
Good call. Looks like there's a few places compilation errors are caught. 👍 |
I think this can be marked as fixed now? Not sure which version of truffle it's in |
Closing since i believe this has been resolved in 5.0.27. |
Alas, it was not solved. with docker: 34 seconds Note that the solc generates different output format (the above test was with I'm using Mac, where I can see the currently running process.
I'm not sure what takes so long, and why the docker image was executed twice (one run can compile all contracts, and anyway, my project had ~10 contracts, including some references to libraries) |
Eek! Alright, re-opening this! Thanks for letting us know! |
Hey @drortirosh , I notice the truffle config in the referenced repo doesn't include the new config setting for speedy parsing. For reference from #2067 :
Hope this helps! |
I noticed the same problem on Truffle 5.0.28, but the config thing above fixed it 👍 I think you can close this again |
Yes, indeed the but I thought the idea was to get rid of solcjs completely (it takes ~4 seconds just to load, even before it starts doing anything) |
Woo! Glad to hear the parser works! @drortirosh We opted to remove Current behavior is that truffle caches a default |
I understand that you use solcjs internally. What I don't understand is why you need it at all when working with solc docker: why parse and compile it 2 steps, when compiling does parsing too. |
IIRC, |
Here's my hack to resolve dependencies for
I agree that this is only a hack, not a general solution. A better solution is to add "search path" to |
Issue
5.0.13 significantly reduced the speed of solc docker compilation for large contract sets. Performance when compiling colonyNetwork on a MacBook Air 1.8 ghz:
The command also hangs before listing the contracts for more than a minute. Believe changes to the imports parsing / profiler in #1913 are the cause. The benefit of the solcjs parsing removed in that PR was that it was fast (see this tcoulter comment from the original implementation).
Steps to Reproduce
Expected Behavior
Using solc docker is faster than using solc-js
Additional notes / suggestion
#1913 resolved several issues. #1720 is one but it also allowed openzeppelin-solidity to run a solc nightly job. Previous versions of truffle had been unable to meet that use case because they couldn't match a solc-js companion to the commit referenced by the docker nightly tag.
There might be a simple internal fix for this but one option is to go back to using a js parser for imports parsing. solidity-parser-antlr is excellent and widely used across the js eco-system. It would be nice if it received grant support and was treated as a core piece of the stack.
The risks of depending on a parser which lags solidity development (slightly) could be mitigated by E2E testing here, having a strong relationship with the project's maintainer and maybe asking solc to ping solidity-antrl4 with grammar changes. Perhaps they could integrate it with their own testing or even add it as a dependency to the npm published solcjs.
Environment
truffle version
): 5.0.12 / 5.0.17node --version
): 10.15.3npm --version
): 6.4.1The text was updated successfully, but these errors were encountered: