4

I have been following a tutorial on Solana native development and need to interact with SPL-Token crate at some point.

However, I can not build (cargo-build-bpf), it throws:

BPF SDK: /Users/user1/.local/share/solana/install/releases/1.9.28/solana-release/bin/sdk/bpf
cargo-build-bpf child: rustup toolchain list -v
cargo-build-bpf child: cargo +bpf build --target bpfel-unknown-unknown --release
    Updating crates.io index
error: failed to select a version for the requirement 'toml_edit = "^0.18"'
candidate versions found which didn't match: 0.14.4, 0.14.3, 0.14.2, ...
location searched: crates.io index
required by package 'proc-macro-crate v1.3.0'
    ... which satisfies dependency 'proc-macro-crate = "^1"' (locked to 1.3.0) of package 'num_enum_derive v0.5.7'
    ... which satisfies dependency 'num_enum_derive = "^0.5.7"' (locked to 0.5.7) of package 'num_enum v0.5.7'
    ... which satisfies dependency 'num_enum = "^0.5.4"' (locked to 0.5.7) of package 'spl-token v3.5.0'
    ... which satisfies dependency 'spl-token = "^3.5.0"' (locked to 3.5.0) of package 'core-4 v0.1.0 (/Users/rog/Desktop/Solana Development/Buildspace/core-4)'

I tried to build on Windows10 (WSL) and on Mac, the result is exactly same.

Any ideas?

1
  • have you managed to resolve this i am also facing the same error message, however I am using an anchor init bootstrap. Commented Feb 1, 2023 at 12:39

3 Answers 3

3

The issue is caused by an outdated Solana version. Updating Solana through CLI helped.

3
  • which version of solana cli are you using
    – Pratik.js
    Commented Jan 30, 2023 at 11:07
  • I am using 1.13.7 and i am getting this error
    – Pratik.js
    Commented Jan 30, 2023 at 11:09
  • I am currently using 1.14.13
    – Oguzhan
    Commented Jan 31, 2023 at 1:27
0

Upgrading Solana CLI tools to 1.14.13, and using anchor 0.25.0 fixed this for me also. (previously using Solana CLI version 1.9.29 and anchor 0.24.2 for compatibility with solana fork running an older version)

0

Updating rust and cargo fixed it for me

  1. rustup update
  2. cargo install cargo-update
  3. cargo install-update -a

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.