fix(config): surface cleanup failures as warnings instead of hard errors#14379
Merged
zerosnacks merged 2 commits intomasterfrom Apr 20, 2026
Merged
fix(config): surface cleanup failures as warnings instead of hard errors#14379zerosnacks merged 2 commits intomasterfrom
zerosnacks merged 2 commits intomasterfrom
Conversation
Cache cleanup is best-effort by design. Instead of silently swallowing errors or making them fatal, return warnings from Config and emit them via sh_warn! at the CLI layer. All cleanup steps now run even if some fail. Amp-Thread-ID: https://ampcode.com/threads/T-019da9b2-d739-753a-a978-71ec793678a5 Co-Authored-By: zerosnacks <95942363+zerosnacks@users.noreply.github.com> Co-Authored-By: Louis Peter Sitoe <202908293+solanaXpeter@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019da9b2-d739-753a-a978-71ec793678a5 Co-Authored-By: zerosnacks <95942363+zerosnacks@users.noreply.github.com> Co-Authored-By: Louis Peter Sitoe <202908293+solanaXpeter@users.noreply.github.com>
a8fae2d to
76e3817
Compare
3 tasks
zerosnacks
approved these changes
Apr 20, 2026
mablr
approved these changes
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Alternative to #14358. Cache cleanup is best-effort by design — silently swallowing errors loses visibility, but making them fatal causes
forge cleanto abort halfway through.This PR takes the middle path:
Config::cleanup()and theclean_*methods returnVec<String>warnings. The forge CLI layer emits them viash_warn!. All cleanup steps always run, failures are visible, nothing aborts.Changes
Config::cleanup()returnsResult<Vec<String>, SolcError>— warnings for non-fatal failures,NotFoundis ignoredproject.cleanup()failure is downgraded to a warning (no more short-circuit)Config::project()force path prints warnings viaeprintln!+yansi(circular dep preventssh_warn!)clean_foundry_cache,clean_foundry_chain_cache,clean_foundry_block_cache,clean_foundry_etherscan_cache,clean_foundry_etherscan_chain_cacheall returnVec<String>warningsforge cleanandforge cache cleanemit warnings viash_warn!use std::ioimport forErrorKind::NotFoundchecksPrompted by: zerosnacks