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
add stop-after stage for semantic analysis #15043
Comments
Hey @0xalpharush! Thanks for reporting this. I have a few comments. The compiler will currently stop after analysis in the case where no options are being requested that could trigger compilation. Devs were running into a bug wherein unnecessary compilation was being performed when Please note that the current behaviour solves your issue unless you have observed any other options (such as the On the flip side, if you were already aware of the above and have a specific use case in mind that is not possible to implement with the current state of the compiler, feel free to outline it for us. |
I don't see how that issue or PR is related to the EDIT: I think I misunderstood and you're suggesting to simply not request |
You understand it correctly. :) So my ask here is for you to mention any possible cases that aren't covered by the current behaviour. In which case, it would make sense to keep this issue open. If not, I would close this issue for now. |
Abstract
Add another option, semantic, to
--stop-after
that produces an equivalent AST as the one produced when the full compilation pipeline is ran. There is an option--stop-after parsing
but it does not do import resolution or populate the reference id's/ exported symbols and thus is insufficient for tools that use semantic analysis info added to the AST, presumably after parsing.Motivation
The compilation pipeline is slow (~30s) on the "average" project relative to what developers expect of developer tooling, and it slows done all developer tooling that request the AST from Solidity for tasks that do not require bytecode. This would benefit all source level analysis tools such as linters, formatters, language servers, code search tools, etc.
Specification
Running
solc file.sol --stop-after semantic
produces an equivalent AST as the one produced when the full compilation pipeline is ran but lowering the AST and generating the bytecode is skipped. Not as important but nice-to-have: this AST should be able to be cached and passed back to solc with the--import-ast
flag and produce the same bytecode as if it were compiled start to finish.Backwards Compatibility
Fully backwards compatible
The text was updated successfully, but these errors were encountered: