crytic / medusa

Parallelized, coverage-guided, mutational Solidity smart contract fuzzing, powered by go-ethereum
https://secure-contracts.com/program-analysis/medusa/docs/src/
GNU Affero General Public License v3.0
301 stars 40 forks source link

Unable to run Medusa due crytic-compile error, corrupted lockfile due to NPM bug #260

Open ljz3 opened 11 months ago

ljz3 commented 11 months ago

I am unable to run medusa due to encountering the issue:

⇾ Reading the configuration file at: /Users/ljz3/Desktop/All/PersonalCoding/testing/hardhat-medusa/medusa.json
⇾ Compiling targets with crytic-compile
error Failed to compile target
‣ error while executing crytic-compile:
        OUTPUT:
        INFO:CryticCompile:'npx hardhat clean' running (wd: /Users/ljz3/Desktop/All/PersonalCoding/testing/hardhat-medusa)
        INFO:CryticCompile:'npx hardhat clean --global' running (wd: /Users/ljz3/Desktop/All/PersonalCoding/testing/hardhat-medusa)
        INFO:CryticCompile:'npx hardhat compile --force' running (wd: /Users/ljz3/Desktop/All/PersonalCoding/testing/hardhat-medusa)
        ERROR:CryticCompile:'npx' returned non-zero exit code 1
        ERROR:CryticCompile:Error HH18: You installed Hardhat with a corrupted lockfile due to the NPM bug #4828.
        stderr: 
        stderr: Please delete your node_modules, package-lock.json, reinstall your project, and try again.
        stderr: For more info go to https://hardhat.org/HH18 or run Hardhat with --show-stack-traces
        ERROR:CryticCompile:Compilation failed. Can you run build command?
        /Users/ljz3/Desktop/All/PersonalCoding/testing/hardhat-medusa/artifacts/build-info is not a directory.

        ERROR: exit status 255

This is on a minimal hardhat repository created with npx hardhat init.

Installation steps I went through:

Environment info: OS: MacOS V14.2, Chip: M2 max node -v: 18.17.0 npm -v: 9.6.7 pip3 --version: 23.3.1

ggrieco-tob commented 11 months ago

Can you reproduce just running crytic-compile .?

ljz3 commented 11 months ago

Hello @ggrieco-tob, thank you for the response.

I ran crytic-compile . on the same repo, and it seems that the command ran successfully with logs:

crytic-compile .

INFO:CryticCompile:'npx hardhat clean' running (wd: /Users/kevinli/Desktop/All/PersonalCoding/testing/hardhat-medusa)
INFO:CryticCompile:'npx hardhat clean --global' running (wd: /Users/kevinli/Desktop/All/PersonalCoding/testing/hardhat-medusa)
INFO:CryticCompile:'npx hardhat compile --force' running (wd: /Users/kevinli/Desktop/All/PersonalCoding/testing/hardhat-medusa)
ggrieco-tob commented 11 months ago

It seems that this issue is specific to medusa, thanks for confirming that. @anishnaik will take care

ljz3 commented 11 months ago

Appears that this is an issue with the release binary, building it from source works.

anishnaik commented 11 months ago

@ljz3 thanks for the additional details. Will look more into this this week.