Why do I get a build error for the resolver feature when I have up to date rustc and cargo version?

Viewed 3876

When I run the build command

cargo build-bpf --manifest-path=Cargo.toml --bpf-out-dir=dist/program 

error: failed to download solana-frozen-abi v1.7.9

Caused by: unable to get packages from source

Caused by: failed to parse manifest at /home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/solana-frozen-abi-1.7.9/Cargo.toml

Caused by: feature resolver is required

There have been people with similar issues but the cause was old rustc version. Mine looks ok

rustc --version
rustc 1.55.0-nightly (7c3872e6b 2021-06-24)

cargo --version
cargo 1.55.0-nightly (9233aa06c 2021-06-22)

My Cargo.toml file looks like

[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"]

I have downloaded the metaplex rust code (exact same dependencies) and the build bpf command compiles successfully.

I have also tried running cargo clean which doesnt change anything.

2 Answers

I fixed it by updating to the latest version (1.7.9) of Solana (which is not the release version):

sh -c "$(curl -sSfL https://release.solana.com/v1.7.9/install)"
Related