Skip to content

FileNotFoundError: [Errno 2] No such file or directory: 'out/build-info'[Bug-Candidate]:  #1785

@joedakwa

Description

@joedakwa

Describe the issue:

I have recently pulled down a repo from GH and i am trying to run basic slither commands from here.

I have currently ran slither . slither . --solc-remaps '@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/'

and had the below output.

'forge clean' running (wd: /home/joedakwa/joe/audits/2023-02-kairos-joedakwa/kairos-contracts)
'forge build --build-info --force' running
Compiling 112 files with 0.8.18
Solc 0.8.18 finished in 26.66s
Compiler run successful

Traceback (most recent call last):
File "/home/joedakwa/.local/lib/python3.10/site-packages/slither/main.py", line 834, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/home/joedakwa/.local/lib/python3.10/site-packages/slither/main.py", line 87, in process_all
compilations = compile_all(target, **vars(args))
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 620, in compile_all
compilations.append(CryticCompile(target, **kwargs))
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 110, in init
self._compile(**kwargs)
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile
self._platform.compile(self, **kwargs)
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/platform/foundry.py", line 90, in compile
hardhat_like_parsing(crytic_compile, self._target, build_directory, self._target)
File "/home/joedakwa/.local/lib/python3.10/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: 'out/build-info'
Error in .
Traceback (most recent call last):
File "/home/joedakwa/.local/lib/python3.10/site-packages/slither/main.py", line 834, in main_impl
) = process_all(filename, args, detector_classes, printer_classes)
File "/home/joedakwa/.local/lib/python3.10/site-packages/slither/main.py", line 87, in process_all
compilations = compile_all(target, **vars(args))
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 620, in compile_all
compilations.append(CryticCompile(target, **kwargs))
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 110, in init
self._compile(**kwargs)
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile
self._platform.compile(self, **kwargs)
File "/home/joedakwa/.local/lib/python3.10/site-packages/crytic_compile/platform/foundry.py", line 90, in compile
hardhat_like_parsing(crytic_compile, self._target, build_directory, self._target)
File "/home/joedakwa/.local/lib/python3.10/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: 'out/build-info'

from the below directory. All the contracts are inside of src.

joe/audits/2023-02-kairos-joedakwa/kairos-contracts/

I tried also running this command:

slither . --solc-remaps '@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/'

from joe/audits/2023-02-kairos-joedakwa/kairos-contracts/src

(src is where the contracts are)

and had the below output.

I have a remappings json file currently looking like this:

{
  "remappings": [
    "@openzeppelin/contracts/token/ERC20/=node_modules/@openzeppelin/contracts/token/ERC20/"
  ]
}

Error: Source "node_modules/@openzeppelin/contracts/token/ERC20/IERC20.sol" not found: File not found. Searched the following locations: "".
--> ClaimFacet.sol:4:1:
|
4 | import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Any advice here?

Code example to reproduce the issue:

N/A

Version:

0.9.2

Relevant log output:

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-candidateBugs reports that are not yet confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions