crytic / slither-action

GNU Affero General Public License v3.0
127 stars 19 forks source link

No such file or directory: 'npx' #48

Closed 0xmichalis closed 5 months ago

0xmichalis commented 1 year ago

Our Slither action has started failing at some point during the last two days with the following error:

[-] Slither config provided: packages/hardhat/slither.config.json
Traceback (most recent call last):
  File "/opt/slither/bin/crytic-compile", line 8, in <module>
    sys.exit(main())
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/__main__.py", line 193, in main
    compilations = compile_all(**vars(args))
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 620, in compile_all
    compilations.append(CryticCompile(target, **kwargs))
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 110, in __init__
    self._compile(**kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile
    self._platform.compile(self, **kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/hardhat.py", line 159, in compile
    detected_paths = self._get_hardhat_paths(base_cmd, kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/hardhat.py", line 304, in _get_hardhat_paths
    config_str = self._run_hardhat_console(base_cmd, print_paths)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/hardhat.py", line 323, in _run_hardhat_console
    with subprocess.Popen(
  File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'npx'

Our action config (hardhat workspace is part of a monorepo):

      - name: Run Slither
        uses: crytic/slither-action@v0.1.1
        with:
          node-version: 16
          ignore-compile: true
          slither-config: packages/hardhat/slither.config.json
          slither-version: v0.8.3
          target: packages/hardhat/

Our Slither config:

{
  "detectors_to_run": "all",
  "exclude_informational": true,
  "exclude_low": true,
  "filter_paths": "node_modules/",
  "ignore_compile": true
}
elopez commented 1 year ago

HI! Thanks for bringing this to our attention. This might be related to our recent releases of slither & crytic-compile, which include a new feature to auto-detect hardhat paths, which might not be working correctly when ignore-compile is set.

As you are not using the latest Slither (I see you have slither-version: v0.8.3 set), can you upgrade your slither-action to the latest release (uses: crytic/slither-action@v0.2.0) and let us know if the issue persists then?

0xmichalis commented 1 year ago

There is a different issue when I upgrade to the latest action version:

Collecting slither-analyzer@ https://github.com/crytic/slither/archive/v0.8.3.tar.gz
  ERROR: HTTP error 404 while getting https://github.com/crytic/slither/archive/v0.8.3.tar.gz
ERROR: Could not install requirement slither-analyzer@ https://github.com/crytic/slither/archive/v0.8.3.tar.gz from https://github.com/crytic/slither/archive/v0.8.3.tar.gz because of HTTP error 404 Client Error: Not Found for url: https://codeload.github.com/crytic/slither/tar.gz/v0.8.3 for URL https://github.com/crytic/slither/archive/v0.8.3.tar.gz
elopez commented 1 year ago

You should specify the version without the v (as in slither-version: 0.8.3) so that it is pulled from PyPI. Any other kind of string there is treated as a Git ref (which v0.8.3 is not a valid one)

0xmichalis commented 1 year ago

@elopez thanks for the quick responses! After updating to 0.2.0 and setting the Slither version without v I am still getting the original error back.

coolhill commented 1 year ago

Error seems to indeed stem from crytic-compile 0.3.0. Is there a way to configure slither-action to run crytic-compile 0.2.4 as a temporary workaround? I get the same error running this:

    - name: Run Slither
      uses: crytic/slither-action@v0.2.0
      continue-on-error: true
      id: slither
      with:
        ignore-compile: true
        sarif: results.sarif
elopez commented 1 year ago

Unfortunately the previous slither release only has a minimum version specified for crytic-compile, so it'll pull the latest version of it 😞

As a temporary workaround, I've made a branch that should return Slither 0.9.2 + ignore-compile to a working state, can you try adding slither-version: dev-workaround-action-48 to the actions' with: block and let me know if that helps?

    - name: Run Slither
      uses: crytic/slither-action@v0.2.0
      continue-on-error: true
      id: slither
      with:
        ignore-compile: true
        sarif: results.sarif
        slither-version: dev-workaround-action-48
coolhill commented 1 year ago

This worked! Thanks!

0xmichalis commented 1 year ago

@elopez fyi, if target is set then paths are handled differently now, is that expected?

[-] Slither config provided: packages/hardhat/slither.config.json
Problem executing hardhat to fetch configuration, using defaults: [Errno 2] No such file or directory: 'npx'
Traceback (most recent call last):
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 834, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 87, in process_all
    compilations = compile_all(target, **vars(args))
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 620, in compile_all
    compilations.append(CryticCompile(target, **kwargs))
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 110, in __init__
    self._compile(**kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile
    self._platform.compile(self, **kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/hardhat.py", line 195, in compile
    hardhat_like_parsing(crytic_compile, self._target, build_directory, hardhat_working_dir)
  File "/opt/slither/lib/python3.9/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: 'packages/hardhat/packages/hardhat/artifacts/build-info'
Error in packages/hardhat/
Traceback (most recent call last):
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 834, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 87, in process_all
    compilations = compile_all(target, **vars(args))
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 620, in compile_all
    compilations.append(CryticCompile(target, **kwargs))
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 110, in __init__
    self._compile(**kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile
    self._platform.compile(self, **kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/hardhat.py", line 195, in compile
    hardhat_like_parsing(crytic_compile, self._target, build_directory, hardhat_working_dir)
  File "/opt/slither/lib/python3.9/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: 'packages/hardhat/packages/hardhat/artifacts/build-info'
      - name: Run Slither
        uses: crytic/slither-action@v0.2.0
        with:
          node-version: 16
          ignore-compile: true
          slither-config: packages/hardhat/slither.config.json
          slither-version: dev-workaround-action-48
          target: packages/hardhat/

EDIT: It does not look expected. If I remove it, I get a different error:

[-] Slither config provided: packages/hardhat/slither.config.json
Traceback (most recent call last):
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 834, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 87, in process_all
    compilations = compile_all(target, **vars(args))
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 641, in compile_all
    compilations.append(CryticCompile(filename, **kwargs))
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 110, in __init__
    self._compile(**kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile
    self._platform.compile(self, **kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/solc.py", line 154, in compile
    targets_json = _get_targets_json(compilation_unit, self._target, **kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/solc.py", line 283, in _get_targets_json
    return _run_solc(
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/solc.py", line 483, in _run_solc
    raise InvalidCompilation(f"{filename} does not exist (are you in the correct directory?)")
crytic_compile.platform.exceptions.InvalidCompilation: . does not exist (are you in the correct directory?)
Error in .
Traceback (most recent call last):
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 834, in main_impl
    ) = process_all(filename, args, detector_classes, printer_classes)
  File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 87, in process_all
    compilations = compile_all(target, **vars(args))
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 641, in compile_all
    compilations.append(CryticCompile(filename, **kwargs))
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 110, in __init__
    self._compile(**kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile
    self._platform.compile(self, **kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/solc.py", line 154, in compile
    targets_json = _get_targets_json(compilation_unit, self._target, **kwargs)
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/solc.py", line 283, in _get_targets_json
    return _run_solc(
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/solc.py", line 483, in _run_solc
    raise InvalidCompilation(f"{filename} does not exist (are you in the correct directory?)")
crytic_compile.platform.exceptions.InvalidCompilation: . does not exist (are you in the correct directory?)
elopez commented 1 year ago

@0xmichalis that looks like a different bug on the crytic-compile hardhat code. I've pushed an extra fix to https://github.com/crytic/crytic-compile/pull/364 which should resolve it. Could you try again and let me know if it works now? (just rerunning the workflow with the correct path and slither-version set should be enough)

0xmichalis commented 1 year ago

@elopez works now, thanks!

0xmichalis commented 1 year ago

@elopez just a note, the branch that contains your fix also uses the latest version of Slither. Are there any plans to backport this fix to work with 0.8.3?

elopez commented 1 year ago

@0xmichalis we don't usually re-release older versions with backported fixes, is there any reason why you'd like to keep using 0.8.3 instead of upgrading?

For the time being I've prepared a second branch you can select with slither-version: dev-workaround-action-48-0.8.3 which is 0.8.3 + a fix to have it continue using the older crytic-compile (0.2.x series). Let me know if that helps.

0xmichalis commented 1 year ago

@elopez amazing, works like a charm! Thanks for the support!

The only reason we don't want to upgrade yet is that 0.9.x has a bunch of new warnings for us to comb through and we'd prefer to upgrade at a latter point in time as currently we are swamped with higher priority work. Definitely plan to upgrade to latest as soon as we can.

fullkomnun commented 1 year ago

@elopez It seems that 'dev-workaround-action-48' branch has been deleted so now the workaround for v0.9.0+ fails

elopez commented 1 year ago

@fullkomnun I've replaced the reference in the workaround branch with a commit hash that should not disappear going forward. No change should be required from your side, just rerun any affected workflows.

sebastiendan commented 1 year ago

Hi, I have a similar issue with a brownie project.

My project structure is the following:

- root/
- - brownie/
- - - contracts/

Whether I'm using the 0.3.0 version of the action or the workaround discussed in this issue (the 0.2.0 action version with the dev-workaround-action-48 slither-version set on the action), I get a No such file or directory brownie. See the logs below.

Action Logs ``` Run crytic/slither-action@v0.2.0 /usr/bin/docker run --name d946[8](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:9)17bc66a6d5e[9](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:10)e42478ac39f610f339c8f_dcbfc5 --label d94681 --workdir /github/workspace --rm -e "INPUT_SLITHER-VERSION" -e "INPUT_SOLC-VERSION" -e "INPUT_NODE-VERSION" -e "INPUT_TARGET" -e "INPUT_SARIF" -e "INPUT_SLITHER-ARGS" -e "INPUT_SLITHER-CONFIG" -e "INPUT_IGNORE-COMPILE" -e "INPUT_FAIL-ON" -e "INPUT_INTERNAL-GITHUB-WORKSPACE" -e "HOME" -e "GITHUB_JOB" -e "GITHUB_REF" -e "GITHUB_SHA" -e "GITHUB_REPOSITORY" -e "GITHUB_REPOSITORY_OWNER" -e "GITHUB_REPOSITORY_OWNER_ID" -e "GITHUB_RUN_ID" -e "GITHUB_RUN_NUMBER" -e "GITHUB_RETENTION_DAYS" -e "GITHUB_RUN_ATTEMPT" -e "GITHUB_REPOSITORY_ID" -e "GITHUB_ACTOR_ID" -e "GITHUB_ACTOR" -e "GITHUB_TRIGGERING_ACTOR" -e "GITHUB_WORKFLOW" -e "GITHUB_HEAD_REF" -e "GITHUB_BASE_REF" -e "GITHUB_EVENT_NAME" -e "GITHUB_SERVER_URL" -e "GITHUB_API_URL" -e "GITHUB_GRAPHQL_URL" -e "GITHUB_REF_NAME" -e "GITHUB_REF_PROTECTED" -e "GITHUB_REF_TYPE" -e "GITHUB_WORKFLOW_REF" -e "GITHUB_WORKFLOW_SHA" -e "GITHUB_WORKSPACE" -e "GITHUB_ACTION" -e "GITHUB_EVENT_PATH" -e "GITHUB_ACTION_REPOSITORY" -e "GITHUB_ACTION_REF" -e "GITHUB_PATH" -e "GITHUB_ENV" -e "GITHUB_STEP_SUMMARY" -e "GITHUB_STATE" -e "GITHUB_OUTPUT" -e "RUNNER_OS" -e "RUNNER_ARCH" -e "RUNNER_NAME" -e "RUNNER_TOOL_CACHE" -e "RUNNER_TEMP" -e "RUNNER_WORKSPACE" -e "ACTIONS_RUNTIME_URL" -e "ACTIONS_RUNTIME_TOKEN" -e "ACTIONS_CACHE_URL" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/_temp/_runner_file_commands":"/github/file_commands" -v "/home/runner/work/topos-smart-contracts/topos-smart-contracts":"/github/workspace" d94681:7bc66a6d5e9e42478ac39f610f339c8f "." "" "" "" "dev-workaround-action-48" [-] SLITHERVER provided, installing slither-analyzer @ https://github.com/crytic/slither/archive/dev-workaround-action-48.tar.gz Collecting wheel Downloading wheel-0.38.4-py3-none-any.whl (36 kB) Installing collected packages: wheel Successfully installed wheel-0.38.4 Collecting slither-analyzer@ https://github.com/crytic/slither/archive/dev-workaround-action-48.tar.gz Downloading https://github.com/crytic/slither/archive/dev-workaround-action-48.tar.gz \ 13.8 MB 14.4 MB/s 0:00:00 Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Collecting crytic-compile@ git+https://github.com/crytic/crytic-compile.git@53167f3f3d63b73916b1660312a53fd952f2e3dd#egg=crytic-compile Cloning https://github.com/crytic/crytic-compile.git (to revision 53167f3f3d63b73916b1660312a53fd952f2e3dd) to /tmp/pip-install-vzpb8pwy/crytic-compile_0440db5ac8a14099b5e9c7be9f9deda4 Running command git clone --filter=blob:none --quiet https://github.com/crytic/crytic-compile.git /tmp/pip-install-vzpb8pwy/crytic-compile_0440db5ac8a14099b5e9c7be9f9deda4 Running command git rev-parse -q --verify 'sha^53167f3f3d63b73916b1660312a53fd952f2e3dd' Running command git fetch -q https://github.com/crytic/crytic-compile.git 53167f3f3d63b73916b1660312a53fd952f2e3dd Running command git checkout -q 53167f3f3d63b73916b1660312a53fd952f2e3dd Resolved https://github.com/crytic/crytic-compile.git to commit 53167f3f3d63b73916b1660312a53fd952f2e3dd Installing build dependencies: started Installing build dependencies: finished with status 'done' Getting requirements to build wheel: started Getting requirements to build wheel: finished with status 'done' Preparing metadata (pyproject.toml): started Preparing metadata (pyproject.toml): finished with status 'done' Collecting packaging Downloading packaging-23.0-py3-none-any.whl (42 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.7/42.7 KB 60.0 MB/s eta 0:00:00 Collecting pycryptodome>=3.4.6 Downloading pycryptodome-3.17-cp35-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 256.2 MB/s eta 0:00:00 Collecting prettytable>=0.7.2 Downloading prettytable-3.6.0-py3-none-any.whl (27 kB) Collecting wcwidth Downloading wcwidth-0.2.6-py2.py3-none-any.whl (29 kB) Collecting cbor2 Downloading cbor2-5.4.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (223 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 223.1/223.1 KB 306.2 MB/s eta 0:00:00 Building wheels for collected packages: slither-analyzer, crytic-compile Building wheel for slither-analyzer (pyproject.toml): started Building wheel for slither-analyzer (pyproject.toml): finished with status 'done' Created wheel for slither-analyzer: filename=slither_analyzer-0.9.2-py3-none-any.whl size=636336 sha256=28ef094ba5af9327cf45a023e42ede113f857b38ef57ecdc1fdfa2d5d7b26625 Stored in directory: /tmp/pip-ephem-wheel-cache-x57dyx6c/wheels/94/de/1e/07230537[10](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:11)8dc9099ae8aefe0b2a8a583cc93e722c1b3950be Building wheel for crytic-compile (pyproject.toml): started Building wheel for crytic-compile (pyproject.toml): finished with status 'done' Created wheel for crytic-compile: filename=crytic_compile-0.3.0-py3-none-any.whl size=91417 sha256=a6362595416092c707c2f2c5cb27a1e43458fdc19805c4a7f88e363180349588 Stored in directory: /tmp/pip-ephem-wheel-cache-x57dyx6c/wheels/ac/a4/ae/e4b8ecd4e939cd688a7c848fc7c9d948583d2269eab3ae20ce Successfully built slither-analyzer crytic-compile Installing collected packages: wcwidth, pycryptodome, prettytable, packaging, cbor2, crytic-compile, slither-analyzer Successfully installed cbor2-5.4.6 crytic-compile-0.3.0 packaging-23.0 prettytable-3.6.0 pycryptodome-3.17 slither-analyzer-0.9.2 wcwidth-0.2.6 [-] SOLCVER was not set; guessing. [-] Guessed 0.8.9. Installing '0.8.9'... Version '0.8.9' installed. Switched global version to 0.8.9 [-] NODEVER was not set, using the latest version. => Downloading nvm from git to '/github/home/.nvm' Cloning into '/github/home/.nvm'... => * (HEAD detached at FETCH_HEAD) master => Compressing and cleaning up git repository => Profile not found. Tried ~/.bashrc, ~/.bash_profile, ~/.zshrc, and ~/.profile. => Create one of them and run this script again OR => Append the following lines to the correct file yourself: export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm => Close and reopen your terminal to start using nvm or run the following to use it now: export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm Downloading and installing node v19.7.0... Downloading https://nodejs.org/dist/v19.7.0/node-v19.7.0-linux-x64.tar.xz... ######################################################## 77.8% ######################################################################## 100.0% Computing checksum with sha256sum Checksums matched! Now using node v19.7.0 (npm v9.5.0) Creating default alias: default -> node (-> v19.7.0 *) [-] Installing dependencies from package-lock.json > @toposware/topos-smart-contracts@1.0.0 install > npm run install:flake8 && npm run install:black && npm run install:eth_abi && npm run install:Crypto && npm run install:web3 > @toposware/topos-smart-contracts@1.0.0 install:flake8 > pip3 install flake8 Collecting flake8 Downloading flake8-6.0.0-py2.py3-none-any.whl (57 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.8/57.8 KB 60.0 MB/s eta 0:00:00 Collecting pycodestyle<2.[11](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:12).0,>=2.10.0 Downloading pycodestyle-2.10.0-py2.py3-none-any.whl (41 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.3/41.3 KB 184.1 MB/s eta 0:00:00 Collecting mccabe<0.8.0,>=0.7.0 Downloading mccabe-0.7.0-py2.py3-none-any.whl (7.3 kB) Collecting pyflakes<3.1.0,>=3.0.0 Downloading pyflakes-3.0.1-py2.py3-none-any.whl (62 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 KB 252.9 MB/s eta 0:00:00 Installing collected packages: pyflakes, pycodestyle, mccabe, flake8 Successfully installed flake8-6.0.0 mccabe-0.7.0 pycodestyle-2.10.0 pyflakes-3.0.1 > @toposware/topos-smart-contracts@1.0.0 install:black > pip3 install black Collecting black Downloading black-23.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 169.8 MB/s eta 0:00:00 Collecting mypy-extensions>=0.4.3 Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB) Collecting click>=8.0.0 Downloading click-8.1.3-py3-none-any.whl (96 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.6/96.6 KB 274.1 MB/s eta 0:00:00 Collecting tomli>=1.1.0 Downloading tomli-2.0.1-py3-none-any.whl ([12](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:13) kB) Collecting platformdirs>=2 Downloading platformdirs-3.1.1-py3-none-any.whl (14 kB) Collecting pathspec>=0.9.0 Downloading pathspec-0.11.0-py3-none-any.whl (29 kB) Requirement already satisfied: packaging>=22.0 in /opt/slither/lib/python3.9/site-packages (from black) (23.0) Collecting typing-extensions>=3.10.0.0 Downloading typing_extensions-4.5.0-py3-none-any.whl (27 kB) Installing collected packages: typing-extensions, tomli, platformdirs, pathspec, mypy-extensions, click, black Successfully installed black-23.1.0 click-8.1.3 mypy-extensions-1.0.0 pathspec-0.11.0 platformdirs-3.1.1 tomli-2.0.1 typing-extensions-4.5.0 > @toposware/topos-smart-contracts@1.0.0 install:eth_abi > pip3 install eth_abi Collecting eth_abi Downloading eth_abi-3.0.1-py3-none-any.whl (28 kB) Collecting eth-typing<4.0.0,>=3.0.0 Downloading eth_typing-3.3.0-py3-none-any.whl (6.3 kB) Collecting parsimonious<0.9.0,>=0.8.0 Downloading parsimonious-0.8.1.tar.gz (45 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.1/45.1 KB 227.6 MB/s eta 0:00:00 Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting eth-utils<3.0.0,>=2.0.0 Downloading eth_utils-2.1.0-py3-none-any.whl (24 kB) Collecting eth-hash>=0.3.1 Downloading eth_hash-0.5.1-py3-none-any.whl (9.0 kB) Collecting cytoolz>=0.10.1 Downloading cytoolz-0.12.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 244.6 MB/s eta 0:00:00 Collecting six>=1.9.0 Downloading six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting toolz>=0.8.0 Downloading toolz-0.12.0-py3-none-any.whl (55 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.8/55.8 KB 243.0 MB/s eta 0:00:00 Building wheels for collected packages: parsimonious Building wheel for parsimonious (setup.py): started Building wheel for parsimonious (setup.py): finished with status 'done' Created wheel for parsimonious: filename=parsimonious-0.8.1-py3-none-any.whl size=42725 sha256=6ab5fd4af15bc47fea4633a283a16a4c63970a2b5c9285cc819c50f46f1c0ba0 Stored in directory: /tmp/pip-ephem-wheel-cache-l11tzyg3/wheels/ae/3f/87/24298980f6c0436680b8b64caac154f542e[13](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:14)8487ed0f90f2a Successfully built parsimonious Installing collected packages: toolz, six, eth-typing, eth-hash, parsimonious, cytoolz, eth-utils, eth_abi Successfully installed cytoolz-0.12.1 eth-hash-0.5.1 eth-typing-3.3.0 eth-utils-2.1.0 eth_abi-3.0.1 parsimonious-0.8.1 six-1.16.0 toolz-0.12.0 > @toposware/topos-smart-contracts@1.0.0 install:Crypto > pip3 install pycryptodome Requirement already satisfied: pycryptodome in /opt/slither/lib/python3.9/site-packages (3.17) > @toposware/topos-smart-contracts@1.0.0 install:web3 > pip3 install web3 Collecting web3 Downloading web3-5.31.3-py3-none-any.whl (501 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 501.8/501.8 KB 110.1 MB/s eta 0:00:00 Collecting jsonschema<5,>=3.2.0 Downloading jsonschema-4.17.3-py3-none-any.whl (90 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.4/90.4 KB 270.8 MB/s eta 0:00:00 Collecting requests<3.0.0,>=2.16.0 Downloading requests-2.28.2-py3-none-any.whl (62 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 KB 253.6 MB/s eta 0:00:00 Collecting websockets<10,>=9.1 Downloading websockets-9.1-cp39-cp39-manylinux2010_x86_64.whl (102 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 102.2/102.2 KB 273.5 MB/s eta 0:00:00 Collecting eth-typing<3.0.0,>=2.0.0 Downloading eth_typing-2.3.0-py3-none-any.whl (6.2 kB) Collecting hexbytes<1.0.0,>=0.1.0 Downloading hexbytes-0.3.0-py3-none-any.whl (6.4 kB) Collecting ipfshttpclient==0.8.0a2 Downloading ipfshttpclient-0.8.0a2-py3-none-any.whl (82 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.6/82.6 KB 262.9 MB/s eta 0:00:00 Collecting lru-dict<2.0.0,>=1.1.6 Downloading lru_dict-1.1.8-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux20[14](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:15)_x86_64.whl (28 kB) Collecting protobuf==3.19.5 Downloading protobuf-3.19.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.1 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 279.4 MB/s eta 0:00:00 Collecting aiohttp<4,>=3.7.4.post0 Downloading aiohttp-3.8.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 265.3 MB/s eta 0:00:00 Requirement already satisfied: eth-hash[pycryptodome]<1.0.0,>=0.2.0 in /opt/slither/lib/python3.9/site-packages (from web3) (0.5.1) Collecting eth-utils<2.0.0,>=1.9.5 Downloading eth_utils-1.10.0-py3-none-any.whl (24 kB) Collecting eth-account<0.6.0,>=0.5.9 Downloading eth_account-0.5.9-py3-none-any.whl (101 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 101.8/101.8 KB 270.9 MB/s eta 0:00:00 Collecting eth-rlp<0.3 Downloading eth_rlp-0.2.1-py3-none-any.whl (5.0 kB) Collecting eth-abi<3.0.0,>=2.2.0 Downloading eth_abi-2.2.0-py3-none-any.whl (28 kB) Collecting multiaddr>=0.0.7 Downloading multiaddr-0.0.9-py2.py3-none-any.whl (16 kB) Collecting charset-normalizer<4.0,>=2.0 Downloading charset_normalizer-3.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (199 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 199.2/199.2 KB 294.7 MB/s eta 0:00:00 Collecting yarl<2.0,>=1.0 Downloading yarl-1.8.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (264 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 264.6/264.6 KB 296.1 MB/s eta 0:00:00 Collecting frozenlist>=1.1.1 Downloading frozenlist-1.3.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl ([15](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:16)8 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 158.8/158.8 KB 279.2 MB/s eta 0:00:00 Collecting async-timeout<5.0,>=4.0.0a3 Downloading async_timeout-4.0.2-py3-none-any.whl (5.8 kB) Collecting multidict<7.0,>=4.5 Downloading multidict-6.0.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (114 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 114.2/114.2 KB 275.6 MB/s eta 0:00:00 Collecting aiosignal>=1.1.2 Downloading aiosignal-1.3.1-py3-none-any.whl (7.6 kB) Collecting attrs>=17.3.0 Downloading attrs-22.2.0-py3-none-any.whl (60 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.0/60.0 KB 247.8 MB/s eta 0:00:00 Requirement already satisfied: parsimonious<0.9.0,>=0.8.0 in /opt/slither/lib/python3.9/site-packages (from eth-abi<3.0.0,>=2.2.0->web3) (0.8.1) Collecting bitarray<3,>=1.2.1 Downloading bitarray-2.7.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (269 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 269.6/269.6 KB 270.4 MB/s eta 0:00:00 Collecting eth-keyfile<0.6.0,>=0.5.0 Downloading eth_keyfile-0.5.1-py3-none-any.whl (8.3 kB) Collecting rlp<3,>=1.0.0 Downloading rlp-2.0.1-py2.py3-none-any.whl (20 kB) Collecting eth-keys<0.4.0,>=0.3.4 Downloading eth_keys-0.3.4-py3-none-any.whl (21 kB) Requirement already satisfied: pycryptodome<4,>=3.6.6 in /opt/slither/lib/python3.9/site-packages (from eth-hash[pycryptodome]<1.0.0,>=0.2.0->web3) (3.17) Requirement already satisfied: cytoolz<1.0.0,>=0.10.1 in /opt/slither/lib/python3.9/site-packages (from eth-utils<2.0.0,>=1.9.5->web3) (0.12.1) Collecting eth-utils<2.0.0,>=1.9.5 Downloading eth_utils-1.9.5-py3-none-any.whl (23 kB) Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 Downloading pyrsistent-0.19.3-py3-none-any.whl (57 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.5/57.5 KB 224.5 MB/s eta 0:00:00 Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.15-py2.py3-none-any.whl (140 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.9/140.9 KB 287.8 MB/s eta 0:00:00 Collecting idna<4,>=2.5 Downloading idna-3.4-py3-none-any.whl (61 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.5/61.5 KB 243.6 MB/s eta 0:00:00 Collecting certifi>=2017.4.17 Downloading certifi-2022.12.7-py3-none-any.whl (155 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 155.3/155.3 KB 292.5 MB/s eta 0:00:00 Requirement already satisfied: toolz>=0.8.0 in /opt/slither/lib/python3.9/site-packages (from cytoolz<1.0.0,>=0.10.1->eth-utils<2.0.0,>=1.9.5->web3) (0.12.0) Requirement already satisfied: six in /opt/slither/lib/python3.9/site-packages (from multiaddr>=0.0.7->ipfshttpclient==0.8.0a2->web3) (1.[16](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:17).0) Collecting varint Downloading varint-1.0.2.tar.gz (1.9 kB) Preparing metadata (setup.py): started Preparing metadata (setup.py): finished with status 'done' Collecting base58 Downloading base58-2.1.1-py3-none-any.whl (5.6 kB) Collecting netaddr Downloading netaddr-0.8.0-py2.py3-none-any.whl (1.9 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.9/1.9 MB 271.4 MB/s eta 0:00:00 Building wheels for collected packages: varint Building wheel for varint (setup.py): started Building wheel for varint (setup.py): finished with status 'done' Created wheel for varint: filename=varint-1.0.2-py3-none-any.whl size=1978 sha256=262bf9788ef5b111395fe6bd4d32f8d875d6df877f000cb0cec81a88e82645c1 Stored in directory: /tmp/pip-ephem-wheel-cache-mmfzluo9/wheels/4b/47/bb/e4fd5cf6101ed8d6a9c52ff50e37bfb908ffdf330ddbbf9550 Successfully built varint Installing collected packages: varint, netaddr, lru-dict, bitarray, websockets, urllib3, pyrsistent, protobuf, multidict, idna, hexbytes, frozenlist, eth-typing, charset-normalizer, certifi, base58, attrs, async-timeout, yarl, requests, multiaddr, jsonschema, eth-utils, aiosignal, rlp, ipfshttpclient, eth-keys, eth-abi, aiohttp, eth-rlp, eth-keyfile, eth-account, web3 Attempting uninstall: eth-typing Found existing installation: eth-typing 3.3.0 Uninstalling eth-typing-3.3.0: Successfully uninstalled eth-typing-3.3.0 Attempting uninstall: eth-utils Found existing installation: eth-utils 2.1.0 Uninstalling eth-utils-2.1.0: Successfully uninstalled eth-utils-2.1.0 Attempting uninstall: eth-abi Found existing installation: eth-abi 3.0.1 Uninstalling eth-abi-3.0.1: Successfully uninstalled eth-abi-3.0.1 Successfully installed aiohttp-3.8.4 aiosignal-1.3.1 async-timeout-4.0.2 attrs-22.2.0 base58-2.1.1 bitarray-2.7.3 certifi-2022.12.7 charset-normalizer-3.1.0 eth-abi-2.2.0 eth-account-0.5.9 eth-keyfile-0.5.1 eth-keys-0.3.4 eth-rlp-0.2.1 eth-typing-2.3.0 eth-utils-1.9.5 frozenlist-1.3.3 hexbytes-0.3.0 idna-3.4 ipfshttpclient-0.8.0a2 jsonschema-4.[17](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:18).3 lru-dict-1.1.8 multiaddr-0.0.9 multidict-6.0.4 netaddr-0.8.0 protobuf-3.19.5 pyrsistent-0.19.3 requests-2.28.2 rlp-2.0.1 urllib3-1.26.15 varint-1.0.2 web3-5.31.3 websockets-9.1 yarl-1.8.2 added 203 packages, and audited 239 packages in 19s 43 packages are looking for funding run `npm fund` for details found 0 vulnerabilities [-] Did not find a requirements.txt, proceeding without installing Python dependencies. [-] Did not find a foundry.toml, proceeding without installing Foundry dependencies. Traceback (most recent call last): File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/brownie.py", line 57, in compile with subprocess.Popen( File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.9/subprocess.py", line [18](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:19)21, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'brownie' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 834, in main_impl ) = process_all(filename, args, detector_classes, printer_classes) File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 87, in process_all compilations = compile_all(target, **vars(args)) File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 6[20](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:21), in compile_all compilations.append(CryticCompile(target, **kwargs)) File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 110, in __init__ self._compile(**kwargs) File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 530, in _compile self._platform.compile(self, **kwargs) File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/brownie.py", line 76, in compile raise InvalidCompilation(error) crytic_compile.platform.exceptions.InvalidCompilation: [Errno 2] No such file or directory: 'brownie' Error in . Traceback (most recent call last): File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/brownie.py", line 57, in compile with subprocess.Popen( File "/usr/local/lib/python3.9/subprocess.py", line 951, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/local/lib/python3.9/subprocess.py", line 18[21](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:22), in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'brownie' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 834, in main_impl ) = process_all(filename, args, detector_classes, printer_classes) File "/opt/slither/lib/python3.9/site-packages/slither/__main__.py", line 87, in process_all compilations = compile_all(target, **vars(args)) File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 620, in compile_all compilations.append(CryticCompile(target, **kwargs)) File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 110, in __init__ self._compile(**kwargs) File "/opt/slither/lib/python3.9/site-packages/crytic_compile/crytic_compile.py", line 5[30](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:31), in _compile self._platform.compile(self, **kwargs) File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/brownie.py", line [76](https://github.com/toposware/topos-smart-contracts/actions/runs/4393748349/jobs/7694353781#step:4:77), in compile raise InvalidCompilation(error) crytic_compile.platform.exceptions.InvalidCompilation: [Errno 2] No such file or directory: 'brownie' ```
elopez commented 1 year ago

Hi @sebastiendan, that looks unrelated to this issue. Brownie is not pre-installed in the action environment, instead it is expected to be installed through the projects' requirements.txt if required. You appear to be missing a requirements.txt file (which in this case should list eth-brownie and any other python deps your project requires to build). Or alternatively, the action target property might be pointing to a different folder?

[-] Did not find a requirements.txt, proceeding without installing Python dependencies.

The requirements.txt file should be on the same folder as your brownie config file, and the action target should point to that folder. See e.g. the brownie token mix for a sample file structure.

elopez commented 5 months ago

I believe there's no pending items here so I'll close the issue, but feel free to open a new one if you experience further issues.