Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple compilation units #16

Closed
daltyboy11 opened this issue Feb 3, 2023 · 4 comments · Fixed by #22
Closed

Add support for multiple compilation units #16

daltyboy11 opened this issue Feb 3, 2023 · 4 comments · Fixed by #22
Labels
enhancement New feature or request

Comments

@daltyboy11
Copy link

I tried running halmos on a project with multiple solidity versions and it failed with this error. Looks to be dependent on crytic fixing their issue: crytic/slither#731

Traceback (most recent call last):
  File "/Users/goldfinch/Library/Python/3.10/bin/halmos", line 8, in <module>
    sys.exit(main())
  File "/Users/goldfinch/Library/Python/3.10/lib/python/site-packages/halmos/__main__.py", line 352, in main
    cryticCompile = CryticCompile(**vars(args))
  File "/Users/goldfinch/Library/Python/3.10/lib/python/site-packages/crytic_compile/crytic_compile.py", line 110, in __init__
    self._compile(**kwargs)
  File "/Users/goldfinch/Library/Python/3.10/lib/python/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile
    self._platform.compile(self, **kwargs)
  File "/Users/goldfinch/Library/Python/3.10/lib/python/site-packages/crytic_compile/platform/foundry.py", line 90, in compile
    hardhat_like_parsing(crytic_compile, self._target, build_directory, self._target)
  File "/Users/goldfinch/Library/Python/3.10/lib/python/site-packages/crytic_compile/platform/hardhat.py", line 49, in hardhat_like_parsing
    os.listdir(build_directory), key=lambda x: os.path.getmtime(Path(build_directory, x))
FileNotFoundError: [Errno 2] No such file or directory: '/Users/goldfinch/dev/mono/packages/protocol/out/build-info'
goldfinch@Daltons-MBP-2 protocol % halmos --foundry-out-directory artifacts
Traceback (most recent call last):
  File "/Users/goldfinch/Library/Python/3.10/bin/halmos", line 8, in <module>
    sys.exit(main())
  File "/Users/goldfinch/Library/Python/3.10/lib/python/site-packages/halmos/__main__.py", line 356, in main
    if len(cryticCompile.compilation_units) > 1: raise ValueError('Multiple compilation units', cryticCompile.compilation_units)
ValueError: ('Multiple compilation units', {'8615e798fbbb13200c971b7468648a8a': <crytic_compile.compilation_unit.CompilationUnit object at 0x1005ee7a0>, '20dd466e29c686f926c505a5ccb8a769': <crytic_compile.compilation_unit.CompilationUnit object at 0x115ca8400>, 'af95935083bd0837625e8f97dcbc31d1': <crytic_compile.compilation_unit.CompilationUnit object at 0x123db9570>})
@daejunpark
Copy link
Collaborator

daejunpark commented Feb 3, 2023

Thanks for reporting this! Would you be able to provide an example to reproduce this error? (I haven't seen a project with multiple compilation units before.)

Based on the trace, the crytic compiler seems to succeed in producing multiple compilation units, so I think it can be just processed one by one in our side.

@daltyboy11
Copy link
Author

Hey @daejunpark! I created a repository with a min repro example: https://github.com/daltyboy11/halmos-min-repro. Steps to repro are in the README.

@hjorthjort
Copy link

Same issue here, would be very nice to be able to get by, many real projects will have multiple compilation units.

@daejunpark
Copy link
Collaborator

Thanks for reporting @daltyboy11 @hjorthjort ! It should be fixed in the latest version. Please feel free to reopen if not!

@daejunpark daejunpark added the enhancement New feature or request label Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants