foundry
foundry copied to clipboard
Foundry recompiles all contracts even on a edit to a single file
Component
Forge
Have you ensured that all of these are up to date?
- [x] Foundry
- [X] Foundryup
What version of Foundry are you on?
forge 0.2.0 (e1eb912 2023-01-17T00:18:00.140138Z)
What command(s) is the bug in?
forge build
Operating System
macOS (Intel)
Describe the bug
Forge recompiles all files regardless of where an edit was made up the dependency tree.
Affects both forge build and forge test so I think it's more of compilation remapping issue vs a specific command issue.
how can I reproduce this?
run forge build
I have the same issue on forge test -w. It seems intermittent. Sometimes its 125 files (everything) sometimes its ~30 files and sometimes just 1 file (the file I changed)
run forge build
sorry, I should have been more clear.
Could you please provide a repro where you encountered this? Couldn't reproduce this myself.
Sometimes its 125 files (everything) sometimes its ~30 files and sometimes just 1 file (the file I changed)
is this 1 file imported somewhere else? see also forge tree
Could you please provide a repro where you encountered this? Couldn't reproduce this myself.
https://github.com/aroralanuk/themis-contracts but you have do yarn install for the hyperlane dependency
@mattsse This sounds like the behavior I described here https://github.com/gakonst/ethers-rs/issues/1995
@mattsse we're experiencing the same issue in our project. I've created a minimal repro here: https://github.com/CarterAppleton/forge-multi-version-compile-issue-repro
lmk if there's other data I can produce to help
Another datapoint - the repro occurs if we have 6.12 and 8.12 (or various other 8 versions), but does not happen for 8.12 and 8.16
@CarterAppleton fwiw, I recently had to nuke the ~/svm directory after having issues getting foundry to download 0.8.18 and my issues seem resolved.
Same issue, running forge 0.2.0 (ce22450 2024-03-06T00:17:08.159969000Z)
Unable to reproduce with https://github.com/CarterAppleton/forge-multi-version-compile-issue-repro, correctly compiles only the corresponding files
There have been significant improvements to the way caches are handled so I'm assuming this has been fixed
Feel free to re-open if you encounter this again (cc @trojanMcAfee) with a minimal reproduction
I have this issue even after foundryup today.
I have this issue even after
foundryuptoday.
@gpxl-dev Can you give me more details about your setup? A minimal reproduction would be appreciated
@gpxl-dev Can you give me more details about your setup
Sorry for the vagueness, was in peak solidity frustration when I hit the issue.
I deleted cache, and out directories and it has started working now. I previously had tried forge cache clean which I'd assumed would delete the contents of the cache dir but maybe it does something else.