Commit f0e771f
fix: use build_info_path from forge config instead of hardcoding (#638)
* fix: use build_info_path from forge config instead of hardcoding
Foundry projects can configure `build_info_path` separately from `out`.
For example, Optimism's contracts-bedrock uses:
- out: forge-artifacts
- build_info_path: artifacts/build-info
Previously crytic-compile assumed build-info was always at `{out}/build-info`,
which caused compilation failures for projects with custom build_info_path.
Changes:
- Add build_info_path field to PlatformConfig
- Read build_info_path from forge config --json
- Use build_info_path when set, fall back to {out}/build-info otherwise
- Fetch forge config before compile check (needed for ignore_compile mode)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: avoid calling forge config when using --ignore-compile
Address review feedback: calling config() early breaks --ignore-compile
because forge may not be available in CI environments without build tools.
Changes:
- Move config() call back inside the compile branch
- Add --foundry-build-info-directory CLI option for users who need custom
build-info paths with --ignore-compile
- Priority order: CLI override > forge config > default ({out}/build-info)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: use modern type union syntax for build_info_path
Replace `Optional[str]` with `str | None` to match the style of
other fields in PlatformConfig and fix the missing import error.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Emilio López <2642849+elopez@users.noreply.github.com>1 parent 9fcfffe commit f0e771f
File tree
4 files changed
+21
-6
lines changed- crytic_compile
- cryticparser
- platform
4 files changed
+21
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
453 | 461 | | |
454 | 462 | | |
455 | 463 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
92 | 93 | | |
93 | 94 | | |
94 | 95 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| |||
199 | 203 | | |
200 | 204 | | |
201 | 205 | | |
| 206 | + | |
202 | 207 | | |
203 | 208 | | |
204 | 209 | | |
| |||
0 commit comments