P.E
P.E

Reputation: 101

Failed to load manifest for dependency

I am trying to import some primitives into pallet in substrate but when I execute cargo check I get this error: failed to load manifest for dependency 'name of primitives'

Dex pallet: https://github.com/Kabocha-Network/cumulus/tree/v0.9.13-elio/pallets/dex

Can somebody please take a look and let me know. Thank you in advance.

Upvotes: 3

Views: 6645

Answers (2)

jakerumbles
jakerumbles

Reputation: 1

My fix for this error was setting the correct branch value, from .17 to .18 in my pallets cargo.toml file. For the sp-io dependency I had branch = "polkadot-v0.9.17" which didn't match the polkadot-v0.9.18 version every other dependency is on.

Original with problem on sp-io (last line)

[dependencies]
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = [
    "derive",
] }
scale-info = { version = "2.0.1", default-features = false, features = ["derive"] }
frame-support = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18"}
frame-system = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }
frame-benchmarking = { default-features = false, version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18", optional = true }
sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.17" }

Fix (sp-io)

sp-io = { default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }

Now the "branch" matches with everything else and my errors are gone! Back to the Substrate Kitties tutorial I go!

Upvotes: 0

Decentration
Decentration

Reputation: 51

if you run cargo check you get:

error: failed to load manifest for workspace member `/root/cumulus/pallets/dex`

Caused by:
  failed to load manifest for dependency `acala-primitives`

Caused by:
  failed to load manifest for dependency `module-evm-utiltity`

Caused by:
  failed to read `/root/cumulus/primitives/modules/evm-utiltity/Cargo.toml`

Caused by:
  No such file or directory (os error 2)

The problem is that /root/cumulus/primitives/modules/evm-utiltity/Cargo.toml, is not found because you haven't included this pallet locally or the pallet is misplaced and located somewhere else.

Simple solutions:

1. Locate and correct

Find where the pallet is and correctly link to it, or import the pallet to the location root/cumulus/primitives/modules/evm-utiltity/Cargo.toml so it can be found.

2. Externally linking rather than importing pallets locally.

You can link to the pallet from its external source rather than importing it locally, otherwise you will find you need to take many more dependencies and store them locally just like the /root/cumulus/primitives/modules/evm-utiltity/Cargo.toml mentioned above in the error.

What you can do instead is:

Go directly to the runtime directory, which is /root/cumulus/parachain-template/runtime/Cargo.toml and link to the external dex directly from github.com/acala-network/acala something like this:

[dependencies.pallet-dexl]
default-features = false
git = 'https://github.com/Acala-Network/acala.git'
branch = polkadot-v0.9.13
version = '3.0.0'

or actually it is still using the older dependency version, which will be like:

pallet-dex = { git = "https://github.com/Acala-Network/acala", default-features = false, branch = "polkadot-v0.9.13" }

and more specifically for this error:

module-evm-utlity = { git = "https://github.com/Acala-Network/acala", default-features = false, branch = "polkadot-v0.9.13" }

but if you link to pallet-dex from its external source, the error should disappear and you will probably not need to link acala-primitives or module-evm-utility.

https://docs.substrate.io/how-to-guides/v3/basics/pallet-integration/

also, evm-utiltity is not spelled correctly (utility).

Upvotes: 2

Related Questions