-
Notifications
You must be signed in to change notification settings - Fork 70
Description
Now that build-info is being cached in foundry, all old build info's under out/build-info are left on disk even after recompiling. Could they be merged into one valid, current build info for the given compilation unit?
For instance, ls out/build-info will accumulate new entires each time I edit a file:
6d5ba56c654d768d5bf8d51bbc3c7e34.json c1f9db2b3d661b08e8fe8c097f2fdad8.json f2030736ea49b0ca4a5709ec90d5910d.json
These also appear in cache/solidity-files-cache.json:
"builds": [
"6d5ba56c654d768d5bf8d51bbc3c7e34",
"c1f9db2b3d661b08e8fe8c097f2fdad8",
"f2030736ea49b0ca4a5709ec90d5910d"
]
Instead, I would expect that there is one build info on disk (assuming one compilation unit) which consists of the aggregate artifacts of the most recent, solidity files still on disk. Otherwise, there is not really a great way to tell whether there are multiple compilation units or if the build info entry is a newer version of a previous entry
I think they could be merged here but lmk if another approach is more desirable
compilers/crates/compilers/src/cache.rs
Line 894 in b04423c
| let cached_builds = cache.read_builds(&project.paths.build_infos).unwrap_or_default(); |
xref foundry-rs/foundry#8164
xref #140