Closed clabby closed 1 month ago
Update: After an hour and a half, the command exited:
hmm, this looks like a solc issue because this is a solc error message
hmm, this looks like a solc issue because this is a solc error message
That is odd. I'm able to generate the IR (in the same repo and dir as @clabby's screenshot) by running solc
directly with this command:
solc --ir "@openzeppelin/=./node_modules/@openzeppelin/" "@rari-capital=./node_modules/@rari-capital" contracts/L1/L1CrossDomainMessenger.sol
Perhaps forge is invoking the compiler incorrectly?
I have experienced the same issue, and you can reproduce it with a very simple contract.
forge inspect Foo ir
will hang, yet solc --ir Foo.sol
will work. Forge version is forge 0.2.0 (59f026f 2023-05-23T17:21:42.593814000Z)
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.19;
contract Foo {
function increment(uint x) external pure returns (uint) {
return x + 1;
}
}
can't reproduce this @daltyboy11
forge init
# add Foo.sol with contract Foo
forge inspect Foo it
it could just be that the solc input args for inspect are causing this, perhaps this is set for the entire input, which leads to long compile times on large repos
@mattsse yea I'm pretty sure the issue is that forge inspect
compiles the full project. I often just do mv test testt; forge inspect <contract> irOpt; mv testt test
and it's significantly faster. Even with that it's still compiling unnecessary src contracts, and ideally it should just compile the minimum set based on the <contract>
specified
we could improve this with some additional effort, but the issue is that inspect
accepts a contract name but we don't really now where this contract exists, so we simply set inspect to all: *
.
we could try to find the contract and its file before calling solc though.
I cannot reproduce this with latest version, time forge inspect L1CrossDomainMessenger ir
output
real 0m0.832s
user 0m1.459s
sys 0m0.140s
@clabby @mds1 could you please recheck and see if it can be closed? thank you!
Confirmed I got similar performance, thank you!
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
da2392e & head at time of writing (8d0099be497922b53cded74b77a3e0b3c1079336)
What command(s) is the bug in?
forge inspect
Operating System
Linux
Describe the bug
When running
forge inspect L1CrossDomainMessenger ir
incontracts-bedrock
, the process seems to perpetually hang. I've had it running for nearly an hour on my Desktop, and the process has not exited.