foundry-rs / foundry

Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
https://getfoundry.sh
Apache License 2.0
8.28k stars 1.75k forks source link

forge test recompilation regression #9124

Closed sakulstra closed 2 weeks ago

sakulstra commented 2 weeks ago

Component

Forge

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

What version of Foundry are you on?

forge 0.2.0 (cc8e430 2024-10-16T00:21:13.978848000Z)

What command(s) is the bug in?

forge test

Operating System

macOS (Apple Silicon)

Describe the bug

Up until recently i'm relatively sure that forge test did not recompile of no files were changed and did partial recompiles when only a few files were changed.

Now I get:

forge test
[⠒] Compiling...
[⠑] Compiling 393 files with Solc 0.8.20

On every forge test.

I think there was some regression a few nightlies ago related to compilation on forge test and i'm only facing this now - not sure what version i was on before upgrading though :/

Tested on this repo: https://github.com/bgd-labs/aave-v3-origin but seems to happen essentially on every repo i have checked.

grandizzy commented 2 weeks ago

@sakulstra I tried locally and cannot reproduce this on subsequent forge test

[⠰] Compiling...
No files changed, compilation skipped

granted I get some test failing like

  [127060] AaveV3BatchDeployment::testAaveV3BatchDeploymentCheck()
    ├─ [0] VM::ffi(["bash", "-c", "response=\"$([ -e .env ] && grep -q \"FOUNDRY_LIBRARIES\" .env && echo true || echo false)\"; cast abi-encode \"response(bool)\" $response;"])
    │   └─ ← [Return] 0x55434920657374653a3a3a3a3a205b426f6f6c2866616c7365295d0a307830303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030
    └─ ← [Revert] EvmError: Revert

Is there any step required other than https://github.com/bgd-labs/aave-v3-origin?tab=readme-ov-file#setup to repro the problem? (tried with simple project created with forge init and don't hit the issue either) Thank you

sakulstra commented 2 weeks ago

@grandizzy, no no other steps needed 🤔 (yes the test failing is expected 😅)

Can it be os related (macos m2)?

DaniPopes commented 2 weeks ago

Also cannot reproduce with either forge build -> forge test or just forge test; please try again after forge clean

sakulstra commented 2 weeks ago

@DaniPopes , sorry after forge clean it works :/

Thx a lot.

DaniPopes commented 2 weeks ago

It's likely some small change in solc input/output in a foundry update that messes up the caching; I would recommend forge clean after foundryup if any similar issue occurs