feat: no force | WARNING: Vibe coded #622
Open
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.
Executive Summary
We use --foundry-compile-all at all times
We want to use differential compilation (recompile only what's necessary)
Test
Change medusa.json[compilation] to:
It seems to work as intended and is faster, I have to test it on a bigger codebase.
I also don't believe you should use this push, but likely this will help get it done fairly easily.
NOTE: For some reason (maybe tied to slither), you need to compile all the first time or medusa will crash.
Below comment from Claude
Incremental Compilation Patch for CryticCompile + Medusa
Problem
CryticCompile calls
forge clean(deletesout/folder) and uses--forceflag on every compilation, causing full rebuilds even when only minor changes are made. This is slow for iterative fuzzing workflows.Root Causes
forge cleanremoves bothout/(artifacts) andcache/directories--forceflag tells Forge to ignore its cache and recompile everything--skip */test/**), so test changes aren't detectedbuild-info/*.jsonfiles, causing CryticCompile to generate multiple compilation units instead of singlecombined_solc.jsonthat Medusa expectsSolution
Added
--foundry-no-forceflag that:forge clean(preservesout/andcache/)--forceflag (enables Forge's incremental compilation)out/build-info/before compilation (prevents multiple compilation units)Files Changed
crytic_compile/cryticparser/defaults.py- Added flag defaultcrytic_compile/cryticparser/cryticparser.py- Added CLI argumentcrytic_compile/platform/foundry.py- Core implementationUsage
Result
combined_solc.jsonas expected by Medusa