Skip to content

refactor: extra files logic#88

Merged
mattsse merged 7 commits intofoundry-rs:mainfrom
klkvr:klkvr/extra-output-from-cache
Mar 11, 2024
Merged

refactor: extra files logic#88
mattsse merged 7 commits intofoundry-rs:mainfrom
klkvr:klkvr/extra-output-from-cache

Conversation

@klkvr
Copy link
Copy Markdown
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 DaniPopes and mattsse 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
Copy Markdown
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!

@mattsse mattsse merged commit 3ed2286 into foundry-rs:main Mar 11, 2024
@frolic
Copy link
Copy Markdown

frolic 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