gpt4 book ai didi

rust - 无法加载依赖 list

转载 作者:行者123 更新时间:2023-12-05 04:39:41 31 4
gpt4 key购买 nike

我正在尝试将一些基元导入基板中的托盘,但是当我执行 cargo 检查时出现此错误:无法加载依赖项“基元名称”的 list

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

有人可以看一下并告诉我吗?提前谢谢你。

最佳答案

如果你运行 cargo check 你会得到:

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)

问题是找不到 /root/cumulus/primitives/modules/evm-utiltity/Cargo.toml,因为您没有在本地包含这个 pallet,或者 pallet 放错了位置别处。

简单的解决方案:

<强>1。定位并更正

找到 pallet 所在的位置并正确链接到它,或者将 pallet 导入位置 root/cumulus/primitives/modules/evm-utiltity/Cargo.toml 以便可以找到它。

<强>2。外部链接而不是本地导入托盘。

您可以从其外部源链接到 pallet 而不是在本地导入它,否则您会发现您需要获取更多依赖项并将它们存储在本地,就像 /root/cumulus/primitives/modules/evm -utiltity/Cargo.toml 上面提到的错误。

你可以做的是:

直接进入runtime目录,即/root/cumulus/parachain-template/runtime/Cargo.toml,直接从github.com/acala-network/acala链接到外部dex像这样:

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

或者实际上它仍在使用旧的依赖版本,就像:

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

更具体地针对此错误:

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

但是如果您从其外部源链接到 pallet-dex,错误应该会消失,您可能不需要链接 acala-primitivesmodule -evm-utility.

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

此外,evm-utiltity 拼写不正确(utility)。

关于rust - 无法加载依赖 list ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70403605/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com