Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

fix(solc): remove changed artifacts from the cache #630

Merged
merged 1 commit into from Nov 28, 2021
Merged

fix(solc): remove changed artifacts from the cache #630

merged 1 commit into from Nov 28, 2021

Conversation

ghost
Copy link

@ghost ghost commented Nov 27, 2021

Motivation

When reading from the cache, there may be changed artifacts that need to be recompiled.
Currently only missing files are removed from the cache metadata struct, but changed files remain.
Since we're now returning the cached artifacts as part of #623 on partial changes and writing new
files to the cache as part of #629, we also need to remove changed files from the cache.

Solution

After getting the changed sources, remove them from the cache metadata (SolFilesCache) so
they are no longer returned.

PR Checklist

  • Added Tests

Duplicate artifacts will be returned if there is a
changed artifact that was already present in the
cache
@ghost ghost changed the title fix: remove changed artifacts from the cache fix(solc): remove changed artifacts from the cache Nov 27, 2021
Copy link
Owner

@gakonst gakonst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great find!
lgtm

@gakonst gakonst merged commit 41f8e29 into gakonst:master Nov 28, 2021
@ghost ghost deleted the cache-remove-changed branch November 28, 2021 16:47
gakonst added a commit to foundry-rs/foundry that referenced this pull request Nov 28, 2021
1. Introduces ethers-solc tracing
2. Fixes various ethers-solc caching bugs
    gakonst/ethers-rs#623
    gakonst/ethers-rs#629
    gakonst/ethers-rs#630
gakonst added a commit to foundry-rs/foundry that referenced this pull request Nov 28, 2021
1. Introduces ethers-solc tracing
2. Fixes various ethers-solc caching bugs
    gakonst/ethers-rs#623
    gakonst/ethers-rs#629
    gakonst/ethers-rs#630
charisma98 added a commit to charisma98/foundry that referenced this pull request Mar 4, 2023
1. Introduces ethers-solc tracing
2. Fixes various ethers-solc caching bugs
    gakonst/ethers-rs#623
    gakonst/ethers-rs#629
    gakonst/ethers-rs#630
0129general added a commit to 0129general/FoundryProject that referenced this pull request May 8, 2024
1. Introduces ethers-solc tracing
2. Fixes various ethers-solc caching bugs
    gakonst/ethers-rs#623
    gakonst/ethers-rs#629
    gakonst/ethers-rs#630
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants