bug(`forge build`): compilation is extremely slow
Component
Forge
Have you ensured that all of these are up to date?
- [X] Foundry
- [X] Foundryup
What version of Foundry are you on?
forge 0.2.0 (515a4cc 2024-08-13T00:20:08.991422000Z)
What command(s) is the bug in?
forge build
Operating System
macOS
Describe the bug
[⠔] Compiling... [⠔] Compiling 1 files with Solc 0.8.26 [⠑] Solc 0.8.26 finished in 490.40s
I don't know why,macos sonoma 14.6.1
Is it a problem with my operating system or a network problem? Is the compilation local or depends on the network?
Hey @vseae thanks for the report
If possible, could you provide a link to the source code that you are building? A single file should not take that long. When re-running the build step after forge clean are you experiencing the same or similar build time?
experiencing a similar issue here
https://github.com/foundry-rs/foundry/issues/8689
My computer is m3 24gb system version Sonoma 14.6.1
The test script tests a token, inherits the Test contract of forge, and the configuration is enabled via_ir = true, compiler version 0.8.26
When I enable via_ir, it takes me at least a minute to compile a file.
This problem seems to only occur in the inheritance of the forge test contract and the latest macos system.
Compiling contract files is several times slower than hardhat.
When I enable via_ir, it takes me at least a minute to compile a file.
this is via_ir overhead
all of this is solc time
resolved by discussion above