foundry-rs / compilers

Utilities for working with native solc and compiling projects.
Apache License 2.0
58 stars 34 forks source link

fix: do not remove dirty artifacts from disk #123

Closed klkvr closed 1 month ago

klkvr commented 1 month ago

ref https://t.me/foundry_support/53263

when running forge test with dirty files, we firstly do a ABI-only compilation which handles dirty files and removes their artifacts from disk. however, we do not write updated cache file as this compilation is ephermal, thus we are ending up with cache file containing artifacts which does not exist, and this causes issues when compiling project normally.

this could be fixed by only removing dirty artifacts when writing cache, but I think this doesn't give us much benefit as we'll overwrite those anyway.

Also changed flow a bit to ensure that we corretly handle graph resultion error when detecting dirty sources.