Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: extra files logic #88

Merged
merged 7 commits into from Mar 11, 2024

Conversation

klkvr
Copy link
Member

@klkvr klkvr commented Mar 8, 2024

Resolves foundry-rs/foundry#6241

Removes write_extra logic from ArtifactOutput trait
Adds new methods:

  • handle_artifacts - by default empty implementation which can be overloaded to implement handling of compiled artifacts. ConfigurableArtifacts implements it to write extra files
  • is_dirty - method allowing ArtifactOutput implementations to reject cached artifacts and enforce recompilation. Used by ConfigurableArtifacts to reject artifacts which data is not enough to write required extra output files.
  • handle_cached_artifacts - same as handle_artifacts but for those which were not recompiled. Used by ConfigurableArtifacts to write extra files from cached artifacts.

@klkvr klkvr requested review from mattsse and DaniPopes March 8, 2024 18:17
@klkvr klkvr requested a review from Evalir as a code owner March 8, 2024 18:17
@klkvr klkvr marked this pull request as draft March 9, 2024 15:27
@klkvr klkvr changed the title fix: write extra output from cache refactor: extra files logic Mar 9, 2024
@klkvr klkvr marked this pull request as ready for review March 10, 2024 09:34
Copy link
Member

@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.

this is a far better solution!

src/artifact_output/mod.rs Outdated Show resolved Hide resolved
@mattsse mattsse merged commit 3ed2286 into foundry-rs:main Mar 11, 2024
14 checks passed
@holic
Copy link

holic commented Mar 11, 2024

thank you!

curious if this also resolves the issue in this comment: foundry-rs/foundry#6241 (comment)

happy to open a new issue if not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

forge build with extra output files doesn't re-run for cached files
3 participants