crytic/echidna

ERROR:CryticCompile:Cannot execute `forge`, is it installed and in PATH?

Closed this issue · 2 comments

I am getting this issue on the following command. It happens when i run this on foundry project (where there would be foundry.toml file present) if i delete foundry.toml then it runs fine. I am running this in VM with shared folder.

Relevant log output:

└─$ echidna . --contract ERC1155CompliantExternalHarness --config contracts/ERC1155/external/test/configExternal.yaml 1 ⨯
[2023-06-04 17:26:18.12] Compiling .... Done! (0.222998551s)
echidna: Couldn't compile given file
stdout:
stderr:
ERROR:CryticCompile:Cannot execute forge, is it installed and in PATH?
INFO:CryticCompile:'forge build --build-info --force' running
Traceback (most recent call last):
File "/home/linuxbrew/.linuxbrew/bin/crytic-compile", line 8, in
sys.exit(main())
^^^^^^
File "/home/linuxbrew/.linuxbrew/Cellar/crytic-compile/0.3.1/libexec/lib/python3.11/site-packages/crytic_compile/main.py", line 221, in main
compilations = compile_all(**vars(args))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.linuxbrew/Cellar/crytic-compile/0.3.1/libexec/lib/python3.11/site-packages/crytic_compile/crytic_compile.py", line 643, in compile_all
compilations.append(CryticCompile(target, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.linuxbrew/Cellar/crytic-compile/0.3.1/libexec/lib/python3.11/site-packages/crytic_compile/crytic_compile.py", line 131, in init
self._compile(**kwargs)
File "/home/linuxbrew/.linuxbrew/Cellar/crytic-compile/0.3.1/libexec/lib/python3.11/site-packages/crytic_compile/crytic_compile.py", line 553, in _compile
self._platform.compile(self, **kwargs)
File "/home/linuxbrew/.linuxbrew/Cellar/crytic-compile/0.3.1/libexec/lib/python3.11/site-packages/crytic_compile/platform/foundry.py", line 66, in compile
with subprocess.Popen(
^^^^^^^^^^^^^^^^^
File "/home/linuxbrew/.linuxbrew/opt/python@3.11/lib/python3.11/subprocess.py", line 1024, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/home/linuxbrew/.linuxbrew/opt/python@3.11/lib/python3.11/subprocess.py", line 1917, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'forge'

Version:

Echidna 2.1.1 and slither 0.9.2

Thanks in advanced!

elopez commented

Hi! do you have foundry installed on your VM? it is needed to compile the project.

Hi,
Oh, foundry is not installed in VM, I thought it works the same as in the case of hardhat because hardhat is not installed in VM still it works for hardhat. I will try installing the foundry now.

Thanks for the answer @elopez 🤝