1

I'm new to Solana dev and was starting up with Anchor on an M1 machine.

While calling anchor build, I receive the following error messages:

Warning: cargo-build-bpf is deprecated. Please, use cargo-build-sbf
cargo-build-bpf child: /.../solana/install/active_release/bin/cargo-build-sbf --arch bpf
error: command failed: 'cargo': Bad CPU type in executable (os error 86)

The versions I have for Solana, Anchor and Rustc are:

❯ anchor --version
anchor-cli 0.25.0
❯ solana --version
solana-cli 1.11.10 (src:843e018c; feat:4253057308)
❯ rustc --version
rustc 1.63.0 (4b91a6ea7 2022-08-08)

3 Answers 3

1

After installing Rust & Cargo you can go this way :

  • Rust : curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

  • Solana CLI Tool :

  • SPL Token Used for interacting token program

    • cargo install spl-token-cli
  • Anchor :

    cargo install --git https://github.com/project-serum/anchor anchor-cli --locked
    
    • adding this to ~/.zshrc file
      • export PATH=/Users/reasje/.cargo/bin:${PATH}

If none worked check this.

0

Go to terminal, install rosetta:

softwareupdate --install-rosetta

Then close the terminal, open a new one and run anchor build again

0

U have to upgrade solana cli to 1.13.5

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

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.