7

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.

1
  • this is due to dependencies in cargo.lock Commented Aug 8, 2021 at 12:22

2 Answers 2

8

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)"
Sign up to request clarification or add additional context in comments.

1 Comment

'solana-install update' also works to update solana
5

The same inputs from Cargo.toml do not mean the the Rust build will be repeatable on other machines — Cargo.lock contains the exact versions used. Additionally, cargo clean doesn't remove Cargo.lock

https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.