-
Notifications
You must be signed in to change notification settings - Fork 341
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
v1.0.0 causes compiling with via-ir
to take substantially longer
#207
Comments
via-ir
takes substantially longervia-ir
to take substantially longer
Does the Solidity version also change between the two tests? |
I stumbled across this Solidity issue from the Seaport release - I don't fully follow the thread, but it seems like |
Looks like compiling forge-std alone with The previous commit |
Update: looks like commit I suspect it is due to the I changed the constructor into a lazy initializer and the compilation went under a minute. |
Do you mean different solc versions? what's your OS? |
@mattsse @leonardoalt @mds1 See my previous comment. |
we're only talking about solc compile times, right? |
can you try this locally and check when you notice it (during or after the compile spinner?). I suspect this is actually testing not compiling. |
I'm using Ubuntu 20.04.4 LTS. Both |
@Vectorized yea I've confirmed that commenting out the @Vectorized wdym by "changed the constructor into a lazy initializer and the compilation went under a minute"? like you moved that into a function that needs to be explicitly called instead of running at construction? |
bool private lazyInitialized;
function lazyInitialize() private {
if (lazyInitialized) return;
lazyInitialized = true;
...
}
function assumeNoPrecompiles(address addr, uint256 chainId) internal virtual {
lazyInitialize();
...
} Caveat is you can't use |
Imo, the greatly improved compilation time for |
@mds1 haven't checked at all but could be related to the optimizer since there's some struct stuff. Can only check tomorrow tho (it's evening here now) |
Ok definitely something weird with Inside solc --base-path . --bin --via-ir --optimize src/Test.sol Now create a file import "./Test.sol";
contract C is Test {} and run solc --base-path . --bin --via-ir --optimize src/a.sol this now hangs. |
Ok that's just because |
So if I build via forge, it takes ~900 seconds. If I run |
I mean solc binary distributions - from issue I linked issue, @hrkrshnn pointed out that the Rust solc binaries that This specific issue might still be a separate edge case, though. Edit: Yeah, ran through the steps in that thread and it seems debug symbols are no longer present - you can ignore me! |
Yea, also have that. Maybe forge is just trying to compile other stuff too that always get similarly stuck? I'm also trying this only on forge-std, it's enough to replicate. |
@mattsse is there a way to only compile a single contract with
And it seems we can rule out an underlying solc error given the speed when invoking solc directly |
@roynalnaruto Are all svm-rs binaries directly from https://binaries.soliditylang.org/ or are some custom compiled? |
Binaries for Mac M1 ( For other targets, i.e. |
Ah I'm |
I wasn't able to reproduce this on solady master (the branch that belongs to the linked CI run is deleted so assuming it was merged)
but was able to reproduce the behavior @leonardoalt described, with solc 0.8.17 on intel mac.
since this happens when invoking solc directly, I don't think this is correct. I thought we already identified the
takes significantly longer for import "./Test.sol";
contract C is Test {} |
Yea exactly, you need to make Test non abstract to make it take long. This seems to be some edge case in the optimizer, someone from Solidity is already taking a look. |
Beware this issue wrt slow build times: foundry-rs/forge-std#207
Beware this issue wrt slow build times: foundry-rs/forge-std#207
Recently, I added a
via-ir
testing to Solady for more robust testing, since it is a library.However, with the latest version of forge-std, the CI is still unable to finish compiling the code after 30 minutes.
See this workflow run: https://github.com/Vectorized/solady/actions/runs/3385556435/jobs/5623841631 (not complete even after 30 minutes)
I left it compiling for more than 3 hours on my machine, to no avail too.
Reverting back
forge-std
to an eariler commitc19dfd2f2a88a461216b0dd1f4961e1a85dcad46
seems to solve the issue.See this workflow run: https://github.com/Vectorized/solady/actions/runs/3386504801/jobs/5625994122 (completes under 2 minutes)
The text was updated successfully, but these errors were encountered: