feat: no force | WARNING: Vibe coded#622
Open
GalloDaSballo wants to merge 2 commits intocrytic:masterfrom
Open
feat: no force | WARNING: Vibe coded#622GalloDaSballo wants to merge 2 commits intocrytic:masterfrom
GalloDaSballo wants to merge 2 commits intocrytic:masterfrom
Conversation
- Move shutil import to top of file - Update clean() to skip when foundry_no_force is set - Update help text to clarify the flag's behavior Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
6104232 to
2e4114f
Compare
elopez
requested changes
Jan 20, 2026
Member
elopez
left a comment
There was a problem hiding this comment.
We currently have a skip clean flag, maybe it should be harmonized with the foundry implementation to drop the force in that case.
Comment on lines
+117
to
+123
| if no_force: | ||
| compile_all = True | ||
| out_dir = foundry_config.out_path if foundry_config else "out" | ||
| build_info_dir = Path(self._project_root, out_dir, "build-info") | ||
| if build_info_dir.exists(): | ||
| shutil.rmtree(build_info_dir) | ||
| LOGGER.info("Cleaned %s for fresh build-info generation", build_info_dir) |
Member
There was a problem hiding this comment.
I feel this goes against the objective described on the PR.
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.
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