-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Do not run coverage if "--via-ir" is enabled #3978
Comments
happy to take over this! just need confirmation on how we should proceed with the issue, as I will have some time next week. The steps I see are:
|
I'm not sure I follow the bug here. Assuming a user wants to compile/deploy with via-ir, and given that
What am I missing here / what is the bug? |
If you don't like the "bug" terminology, I am happy to let go of it in this context. My point is simply that it would be nice for Forge to give a clearer error when the user attempts to run the coverage command and they have |
Do you mean a more clear error when Note that this would also apply when the user doesn't use via-ir, but does use the regular optimizer (i.e. via-ir isn't unique here) |
I mean failing early - not even trying to compile if Forge sees that It is odd that you say that the regular optimizer is not supported, because I have managed to successfully obtain a coverage report even with the optimizer enabled. |
Hmm I think we might be misunderstanding each other a bit here. @mattsse can correct me if I'm wrong but my understanding of forge coverage is it behaves as follows: when you run In your case, it just meant your contracts are able to be compiled both with and without the optimizer.
Say I want to deploy with via-ir because it results in cheaper functions for users. Let's also say my contract still compiles normally, even if via-ir is not used. In this case, why would I want |
Oh, I didn't know this! Oh my goodness. It all makes sense now. The reason I thought otherwise was because my code used to not compile without
yeah, you wouldn't want that in this case. As per my explanation above, this was a misunderstanding on my end. I will close this issue now. |
Thanks a lot for elucidating this issue for me, @mds1! |
No problem! |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (d3d8c0b 2022-12-24T12:38:26.644536Z)
What command(s) is the bug in?
forge coverage
Operating System
macOS (Apple Silicon)
Describe the bug
See discussion in #3527, particularly this comment.
If the coverage command is not meant to run over IR-optimized code, I consider it a bug that the coverage implementation does not catch the activation of
--via-ir
, and does not throw a more specific error to the user.The text was updated successfully, but these errors were encountered: