graphprotocol / graph-tooling

Monorepo for various tools used by subgraph developers.
https://thegraph.com/docs
Apache License 2.0
387 stars 206 forks source link

Graph test command fails with 'No such file or directory' #1352

Closed OscBacon closed 1 week ago

OscBacon commented 1 year ago

Which packages are impacted by your issue?

@graphprotocol/graph-cli

Describe the issue

Even on the demo-subgraph repository, I am unable to run the tests. Matchstick is failing with a "No such file or directory" error, but there is no detail of what it cannot find. I am running WSL 2, 5.15.90.1-microsoft-standard-WSL2.

pnpm run test

> demo@0.1.0 test /home/baracoso/projects/LimeChain/demo-subgraph
> graph test

Skipping download/install step because binary already exists at /home/baracoso/projects/LimeChain/demo-subgraph/node_modules/.pnpm/binary-install-raw@0.0.13_debug@4.3.4/node_modules/binary-install-raw/bin/0.5.4

___  ___      _       _         _   _      _
|  \/  |     | |     | |       | | (_)    | |
| .  . | __ _| |_ ___| |__  ___| |_ _  ___| | __
| |\/| |/ _` | __/ __| '_ \/ __| __| |/ __| |/ /
| |  | | (_| | || (__| | | \__ \ |_| | (__|   <
\_|  |_/\__,_|\__\___|_| |_|___/\__|_|\___|_|\_\

Compiling...

💬 Compiling token-lock-wallet/token-lock-wallet...
thread 'main' panicked at '🆘 Internal error during compilation: No such file or directory (os error 2).
Command path: "/home/baracoso/projects/LimeChain/demo-subgraph/node_modules/assemblyscript/bin/asc"
Globals path: "/home/baracoso/projects/LimeChain/demo-subgraph/node_modules/@graphprotocol/graph-ts/global/global.ts"
Libs folder: "/home/baracoso/projects/LimeChain/demo-subgraph/node_modules"', src/compiler/mod.rs:131:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
 ELIFECYCLE  Test failed. See above for more details.

Reproduction

github.com/LimeChain/demo-subgraph

Steps to Reproduce the Bug or Issue

pnpm install
pnpm run build
pnpm run test

Note: I get the same results with yarn

Expected behavior

tests passing

Screenshots or Videos

No response

Platform

Subgraph Manifest

No response

Subgraph GraphQL Schema

No response

Additional context

No response

saihaj commented 1 year ago

ideas @dimitrovmaksim?

dimitrovmaksim commented 1 year ago

It doesn't work well with pnpm, because it depends on the assemblyscript package to be installed in node_nodules This Issue may be helpful https://github.com/LimeChain/matchstick/issues/324#issuecomment-1545873270. Also when installing the assemblyscript package keep in mind to use version 0.19.x,

OscBacon commented 1 year ago

Thank you @dimitrovmaksim, changing the assemblyscript package version to ^0.19.0, and using yarn instead (the recommended package manager here I believe) fixed it