当我运行构建命令时
cargo build-bpf --manifest-path=Cargo.toml --bpf-out-dir=dist/program
错误:下载失败solana-frozen-abi v1.7.9
原因:无法从源获取包
原因:未能解析清单/home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/solana-frozen-abi-1.7.9/Cargo.toml
原因:resolver
需要功能
有人遇到类似问题,但原因是旧的 rustc 版本。我的看起来不错
rustc --version
rustc 1.55.0-nightly (7c3872e6b 2021-06-24)
cargo --version
cargo 1.55.0-nightly (9233aa06c 2021-06-22)
我的 Cargo.toml 文件看起来像
[package]
name = "test"
version = "0.0.1"
edition = "2018"
exclude = ["tests/**"]
[features]
no-entrypoint = []
test-bpf = []
[dependencies]
borsh = "0.8.2"
num-derive = "0.3"
num-traits = "0.2"
solana-program = "1.6.10"
spl-token = { version="3.1.1", features = [ "no-entrypoint" ] }
thiserror = "1.0"
[dev-dependencies]
solana-program-test = "1.6.10"
solana-sdk = "1.6.10"
[lib]
crate-type = ["cdylib", "lib"]
我已经下载了 metaplex rust 代码(完全相同的依赖项)并且 build bpf 命令编译成功。
我也尝试过运行 cargo clean ,这不会改变任何东西。