1

When I execute the command cargo build-bpf, I encounter an error. How can I resolve this issue?

error: package `libp2p-allow-block-list v0.3.0 (https://github.com/sigp/rust-libp2p/?rev=cfa3275ca17e502799ed56e555b6c0611752e369#cfa3275c)` cannot be built because it requires rustc 1.73.0 or newer, while the currently active rustc version is 1.72.0-dev Either upgrade to rustc 1.73.0 or newer, or use cargo update -p [email protected] --precise ver where `ver` is the latest version of `libp2p-allow-block-list` supporting rustc 1.72.0-dev

solana-cli:1.18.4
rustc: 1.76.0
rustup: 1.26.0

2 Answers 2

0

Similar to https://solana.stackexchange.com/a/9799/84: if you need to use a newer version of the Solana Rust compiler, you can use the --tools-version argument. In your case, you can try:

cargo build-sbf --tools-version v1.41
0

This solution Solves Everything!:

Type these in the terminal:

solana-install init 1.18.18(or latest version/version/version you’re using, mine worked with 1.18.18)

cargo add solana-program@=1.18.18

cargo update -p [email protected]

Cargo clean

Anchor clean

Anchor build

This works because using the Solana init command above FIRST makes sure that the build tools are properly initialized.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.