foundry icon indicating copy to clipboard operation
foundry copied to clipboard

forge build --deny-warnings fail when no warnings issued

Open hellwolf opened this issue 2 years ago • 5 comments

Component

Forge

Have you ensured that all of these are up to date?

  • [X] Foundry
  • [ ] Foundryup

What version of Foundry are you on?

forge 0.2.0 (ca67d15 2023-08-02T00:16:51.291393754Z)

What command(s) is the bug in?

forge build --deny-warnings

Operating System

Linux

Describe the bug

No warnings issued from compliation, but forge build --deny-warnings still exit with failure.

I have tried to reproduce with a smaller example, but I could not. Here is a full reproduciable case:

$ forge --version
forge 0.2.0 (ca67d15 2023-08-02T00:16:51.291393754Z)
$ git clone https://github.com/superfluid-finance/protocol-monorepo.git
...
$ cd protocol-monorepo/
$ yarn install
...
$ cd packages/ethereum-contracts/
$ forge build --deny-warnings 
[⠊] Compiling...
[⠘] Compiling 167 files with 0.8.19
[⠰] Solc 0.8.19 finished in 42.73s
Error: 
Compiler run failed:

hellwolf avatar Aug 17 '23 07:08 hellwolf

this is happening for me with ignored_error_codes=["same-varname"], the output is showing empty/blank warnings after ignoring the rule, which is probably triggering the failure:

➜  forge build
[⠊] Compiling...
[⠒] Compiling 5 files with Solc 0.8.24- 
[⠑] Solc 0.8.24 finished in 1.54s
Compiler run successful with warnings:
➜  forge build --deny-warnings
[⠊] Compiling...
[⠒] Compiling 4 files with Solc 0.8.24
[⠢] Solc 0.8.24 finished in 1.06s
Error: 
Compiler run failed:

ryanio avatar Jul 02 '24 22:07 ryanio

I can see that clean build produces a warning

Compiler run successful with warnings:
Warning (5574): Contract code size is 24649 bytes and exceeds 24576 bytes (a limit introduced in Spurious Dragon). This contract may not be deployable on Mainnet. Consider enabling the optimizer (with a low "runs" value!), turning off revert strings, or using libraries.
   --> packages/ethereum-contracts/contracts/mocks/SuperfluidMock.sol:130:1:
    |
130 | contract SuperfluidMock is Superfluid {
    | ^ (Relevant source part starts here and spans across multiple lines).

Could you try updating foundry to latest nightly and see if something changes for you?

klkvr avatar Jul 03 '24 00:07 klkvr

ah sorry, I've tried it on repo from the initial issue description

@ryanio could you try doing forge clean and then running forge build to see if there are any warning printed?

klkvr avatar Jul 03 '24 00:07 klkvr

Found a easier to reproduce case, perhaps related, https://github.com/foundry-rs/foundry/issues/8342

hellwolf avatar Jul 03 '24 14:07 hellwolf

@hellwolf is this still an issue? I tried to reproduce but wasn't able, though noticed the solc version was changed since issue reported

[⠢] Compiling...
[⠆] Compiling 209 files with Solc 0.8.26
[⠃] Solc 0.8.26 finished in 29.01s
Compiler run successful!

thank you!

grandizzy avatar Oct 15 '24 10:10 grandizzy

@hellwolf we're going to optimistically close this one as wasn't able to reproduce. Please reopen if still an issue. Thank you!

grandizzy avatar Oct 29 '24 12:10 grandizzy