-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
chore: warn optimization is disabled when forge coverage is called #8840
Comments
Please check discussions in #8695 and limitations when using such |
@grandizzy That issue only talks about the |
The difference is that forge coverage disables any optimization, ir-minimum is an option but is not reliable |
Yeah that's also ok, @grandizzy! The codebase compiles and runs through the tests without any optimizations as well. Coverage should also just work but it doesn't. |
Interesting, can you share code to reproduce and debug locally? |
Yeah that's what I want to do, but the codebase is currently private (let me see if I can just make it public) and since the error doesn't tell me which file it is it's hard to create a small reproduction. |
ah, too bad. Don't think would help, but at least the foundry.toml to check settings then? |
Here's the [profile.default]
# Directory Setup
src = "contracts"
script = "script"
test = "test"
# Compiler Options
solc_version = "0.8.25"
evm_version = "shanghai"
# Permissions
fs_permissions = [{ access = "read-write", path = "./" }]
Also, related question, would you know why with |
re settings, just a try, if you set Re tests not passing, there are several things that could go wrong, one of them being related to block.timestamp / skip / warp, e.g. #8756 (comment) |
Oof, explicitly setting Thanks for the insights on This would really suck if this is a compiler issue in the end. |
yeah, not sure there's anything we could do at the moment but exploring other paths |
via-ir
but coverage does not.forge test
works without --via-ir
but coverage does not
context:
our proposal would be to add a WARN when |
forge test
works without --via-ir
but coverage does not
same happened for me, forge coverage changes the out folder and without noticing it, we tried to deploy the unoptimized contract and failed because of contract size. @jenpaff |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (ea3ba89 2024-09-05T00:28:03.529093300Z)
What command(s) is the bug in?
No response
Operating System
Windows
Describe the bug
The codebase does not have
viaIR
enabled.forge compile
-> worksforge test
-> works - all tests passforge coverage
-> fails (error below)forge coverage --ir-minimum
-> works but tests failError: (
forge coverage
)This is super confusing given that just running the tests is fine but running with coverage doesn't compile and when you enable
ir
the tests themselves break.The text was updated successfully, but these errors were encountered: