-
Notifications
You must be signed in to change notification settings - Fork 84
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
hardhat: support multiple build info files #164
Comments
This is a breaking change (see the PR notes)
This is a breaking change (see the PR notes) Please enter the commit message for your changes. Lines starting
Hey @montyly! Someone pointed me to this issue, and thought I could clarify things a bit. Hardhat normally creates multiple build info files, one per compilation job. Recompiling a project doesn't mean that the same compilation job is going to be created, as we don't recompile things that haven't changed. For example you can start with a single compilation job that builds everything, and hence a single build info file. Then modify a single file, recompile, and a new compilation job that only compiles it is created, so you end up with two build info files. Note that the first build info file will still have info about the recompiled contract. The way to navigate these files is to start from the artifact's |
Hi @alcuadrado Thanks a lot for writing this, I was not aware of this partial recompiling behavior, it's nice. I explored the idea of using the We might switch to a workflow where we run |
Is this following error due to my version of crytic-compile? Command echidna-test . --contract <Contract Name> echidna-test: Couldn't compile given file
stdout:
stderr:
INFO:CryticCompile:'npx hardhat compile --force' running
INFO:CryticCompile:Compiling 70 files with 0.7.4
Generating typings for: 71 artifacts in dir: build/types for target: ethers-v5
Successfully generated 125 typings!
Compilation finished successfully
Traceback (most recent call last):
File "/usr/local/bin/crytic-compile", line 33, in <module>
sys.exit(load_entry_point('crytic-compile==0.2.2', 'console_scripts', 'crytic-compile')())
File "/usr/local/lib/python3.9/site-packages/crytic_compile/__main__.py", line 192, in main
compilations = compile_all(**vars(args))
File "/usr/local/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 637, in compile_all
compilations.append(CryticCompile(target, **kwargs))
File "/usr/local/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 117, in __init__
self._compile(**kwargs)
File "/usr/local/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 548, in _compile
self._platform.compile(self, **kwargs)
File "/usr/local/lib/python3.9/site-packages/crytic_compile/platform/hardhat.py", line 87, in compile
os.listdir(build_directory), key=lambda x: os.path.getmtime(Path(build_directory, x))
FileNotFoundError: [Errno 2] No such file or directory: 'artifacts/build-info' This is in the root directory btw, targeting a contract inside the /contracts/ folder |
We currently only take the first file in the build-info directory:
crytic-compile/crytic_compile/platform/hardhat.py
Line 98 in e45c759
However, it appears that hardhat can now generate multiple files and the others are thus not analyzed.
A breaking change to support multiple build-info files, is that because there are all compiled separately it is likely to break third-party integrations (see crytic/slither#731)
The text was updated successfully, but these errors were encountered: