-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't fully compiler/check imports. #2862
Comments
The main reason for this is that there is not yet a way to specify which contract you actually want to have compiled (there is an open issue about that and I think @axic started an implementation). For the normal commandline solc, we could compile just the contracts in the first source file specified, but that won't work for all versions. What you could do is use interfaces, basically the same workaround C is using with its header files. It's not nice, but at least it will help until we have the proper solution. |
That is our current planned workaround, but as anyone who has worked with C knows its quite the PITA to maintain duplicates of every file. |
I don think headers are duplicates, they have a different purpose. Similarly, |
I also think this should be solved in collaboration with the package managers - for example truffle seems to call the compiler once for each source file, while a single call for everything should be enough. @axic perhaps we could implement the output selection to a point where you specify a single file and just want everything from there, since this seems to be the feature required by truffle. More fine-grained control can be added later. |
Our (Augur's) build/test pipeline is pretty naive right now. At the moment it compiles each file separately, rather than compiling the whole project. This could be improved such that we compile the entire project in one call to solc rather than compiling each independently. Right now I'm going through the codebase and making everything have a separate Interface file and the compilation times are decreasing by 60-100 fold. |
@chriseth @MicahZoltu Is this issue solved by #8739 ? |
I'll defer to @chriseth on that. I'm not actively working on the aforementioned project anymore so I wouldn't be able to help test. |
I would say we can close it. |
At the moment, it appears that Solidity is doing a full check/compile of imported contracts. However, it could save notable time by instead just parsing enough to get the contracts and function signatures which is all that is needed by the importer.
Compilation time on some of my contracts is up to minutes because the import hierarchy is large. I would really like to get this number down, and one way would be if imported contracts weren't fully compiled and instead were just parsed.
The text was updated successfully, but these errors were encountered: