Skip to content
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

Fix detection of node_modules/ in monorepos #279

Open
0xalpharush opened this issue Jul 7, 2022 · 5 comments · Fixed by #324
Open

Fix detection of node_modules/ in monorepos #279

0xalpharush opened this issue Jul 7, 2022 · 5 comments · Fixed by #324

Comments

@0xalpharush
Copy link
Contributor

We need a way to find node_modules for monorepo that is more robust
This is especially sticky for monorepo projects where something like @openzeppelin/* is not installed in the relative node_modules/ but in the root workspace. Yarn 2 removed nohoist as well, so I haven't really found a good solution to this yet.

A temporary workaround is to symlink the relevant packages into the relative/workspace's node_modules/ dir but that gets pretty annoying and is temporary.

ETA: A solution is adding the following to the package.json for the contract package:

"installConfig": {
  "hoistingLimits": "dependencies"
},

Originally posted by @mikeshultz in crytic/slither#852 (comment)

@montyly
Copy link
Member

montyly commented Jul 8, 2022

Related to #79.

Adding a --additional-directory flag could fix the issue

@vhawk19
Copy link

vhawk19 commented Aug 20, 2022

Currently trying to work on this issue, just wanted to clarify if the fix would be platform dependent and if so should it support all the platforms?

@jubeira
Copy link

jubeira commented Oct 27, 2022

Is there any progress on this? It would be really useful to support monorepos / custom node_modules paths.

This could be solved adding a flag and one more elif at this point: https://github.com/crytic/crytic-compile/blob/master/crytic_compile/utils/naming.py#L109, allowing to customize where node_modules is.

@asmitadhungana
Copy link

Hi, this issue is still prevalent. I got this error while trying to run my fuzz tests with echidna in a monorepo contract.
Tried the given solutions to no avail.
Any help would be appreciated.

@0xalpharush
Copy link
Contributor Author

@asmitadhungana Would you be able to open an issue and provide more detail on your setup and what command you ran please? It'd be helpful if you could share the code as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants