Skip to content

Commit c4a2480

Browse files
dguidoclaude
andauthored
feat: warn when multiple frameworks detected (#643)
* feat: warn when multiple frameworks detected When multiple build frameworks are detected for a target, emit a warning listing all detected frameworks and which one will be used. Users can override the selection with --compile-force-framework. Fixes #414 Co-Authored-By: Claude Opus 4.5 <[email protected]> * fix: format framework names as comma-separated list in warning Co-Authored-By: Claude Opus 4.5 <[email protected]> --------- Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent c8f3cbe commit c4a2480

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

crytic_compile/crytic_compile.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,16 @@ def _init_platform(self, target: str, **kwargs: str) -> AbstractPlatform:
608608
)
609609

610610
if not platform:
611-
platform = next(
612-
(p(target) for p in platforms if p.is_supported(target, **kwargs)), None
613-
)
611+
matching_platforms = [p for p in platforms if p.is_supported(target, **kwargs)]
612+
if len(matching_platforms) > 1:
613+
names = [p.NAME for p in matching_platforms]
614+
LOGGER.warning(
615+
"Multiple frameworks detected: %s. Using %s (highest priority). "
616+
"Use --compile-force-framework to override.",
617+
", ".join(names),
618+
matching_platforms[0].NAME,
619+
)
620+
platform = matching_platforms[0](target) if matching_platforms else None
614621

615622
if not platform:
616623
platform = Solc(target)

0 commit comments

Comments
 (0)