2

I was following this tutorial https://docs.substrate.io/tutorials/v3/kitties/pt1/

after pulling from the https://github.com/substrate-developer-hub/substrate-node-template and its tutorials/solutions/kitties branch, VS Code rust-analyzer indicates errors below... I have made no change at all.

in runtime/src/lib.rs

  • error1: OUT_DIR not set, enable "run build scripts" to fix
  • error2: unresolved import
  • error3: unresolved import
  • error4: unresolved import
  • rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file ../substrate-node-template-tutoSolnKitties/Cargo.toml, cargo 1.58.0 (f01b232bc 2022-01-19): Failed to run "cargo" "metadata" "--format-version" "1" "--manifest-path" "../substrate-node-template-tutoSolnKitties/Cargo.toml" "--filter-platform" "x86_64-unknown-linux-gnu": cargo metadata exited with an error: Updating git repository https://github.com/paritytech/substrate.git error: failed to get frame-benchmarking as a dependency of package node-template v4.0.0-dev (../substrate-node-template-tutoSolnKitties/node) Caused by: failed to load source for dependency frame-benchmarking Caused by: Unable to update https://github.com/paritytech/substrate.git?tag=devhub/latest#352c46a6 Caused by: object not found - no match for id (352c46a648a5f2d4526e790a184daa4a1ffdb3bf); class=Odb (9); code=N...

and many "unresolved import" errors in node/src/chain_spec.rs, node/src/rpc.rs, node/src/service.rs files

Then the build failed, too

cargo build -p pallet-kitties

substrate-node-template-tutoSolnKitties git:(tutorials/solutions/kitties) cargo build -p pallet-kitties

Updating git repository https://github.com/paritytech/substrate.git error: failed to get frame-benchmarking as a dependency of package node-template v4.0.0-dev (../substrate-node-template-tutoSolnKitties/node)

Caused by: failed to load source for dependency frame-benchmarking

Caused by: Unable to update https://github.com/paritytech/substrate.git?tag=devhub/latest#352c46a6

Caused by: object not found - no match for id (352c46a648a5f2d4526e790a184daa4a1ffdb3bf); class=Odb (9); code=NotFound (-3)

enter image description here

Environment

  • VS Code the latest
  • rust-analyzer v0.3.933
  • Linux Mint 20.3 Una with base: Ubuntu 20.04 focal
  • Rust 1.58.1
2
  • 5
    This sounds like it's a bug issue, you should instead report it on the relevant repositories on GitHub rather than asking on SE. Commented Feb 10, 2022 at 4:59
  • 1
    I also had issues getting this tutorial to function. They do have this issue in the repository (which you may note that the kitties tutorial has not been checked off of yet): substrate.stackexchange.com/questions/113/…
    – tarrball
    Commented Feb 10, 2022 at 23:24

0

Browse other questions tagged or ask your own question.