This repository has been archived by the owner on Oct 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 795
Cache does not contain all artifacts when multiple versions exist #1995
Labels
bug
Something isn't working
Comments
4 tasks
2 tasks
Hey @gakonst I'd be willing to take this. I working based off of @0xalpharush's #1964 that currently resolves this issue but in a hamfisted way that needs refinement. I'd be happy to keep working on this to get it into main 😄 |
Yeah we'd love to get this over the line on top of @0xalpharush's work, and happy to help |
Closed
2 tasks
2 tasks
This was referenced Apr 24, 2024
Open
@klkvr can this also be migrated to foundry-compilers. This more likely has been fixed but it may be helpful as a regression test |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version
This exists on master and can be reproduced on recent versions of foundry:
forge 0.2.0 (848bb44 2022-12-28T00:13:43.163127Z)
.Platform
Darwin macbook arm64
Description
In the following example,
lib/forge-std/src/Test.sol
is compiled using0.8.10
and0.8.17
and both artifacts are written toout/
. However, if you runforge build && cat cache/solidity-files-cache.json | jq '.files["lib/forge-std/src/Test.sol"].artifacts'
repeatedly it seems to cause unnecessary compilation due to the artifacts not being stored for multiple versions.This issue seems related to these changes e.g. delete this snippet and
forge build
will include both artifacts. This doesn't totally address the issue because ifforge build
is run again the cache won't always include both artifacts or the names are inconsistent due to (#1491). There needs to be some notion that a file is not obsolete but is not currently being written either.Fixing this should probably be unified with #1964 or done as a prerequisite.
I tried this code:
The artifacts exist
But not all of them are cached
If I run forge build again, it will contain the artifacts for
0.8.10
but not0.8.17
or vice versa.I expected to see this happen:
The text was updated successfully, but these errors were encountered: