0

I'm following the Anchor docs here, but I keep getting this error...

BPF SDK path does not exist: /Users/herbie/.cargo/bin/sdk/bpf: No such file or directory (os error 2)

I ran ls -al /Users/herbie/.cargo/bin and got this output:

total 239152
drwxr-xr-x  17 herbie  staff       544 31 Jan 16:55 .
drwxr-xr-x   9 herbie  staff       288 13 Dec 11:58 ..
-rwxr-xr-x   1 herbie  staff  12574724 31 Jan 16:49 anchor
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 cargo
-rwxr-xr-x   1 herbie  staff   7578989 14 Dec 14:05 cargo-build-bpf
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 cargo-clippy
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 cargo-fmt
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 cargo-miri
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 clippy-driver
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rls
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rust-gdb
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rust-lldb
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rustc
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rustdoc
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rustfmt
-rwxr-xr-x  12 herbie  staff   8521112 31 Jan 16:55 rustup

Haven't found much online, and have never heard of BPF before...

2 Answers 2

0

It's unclear when you're getting the error during the installation, but here's a few things to try:

For more reference, BPF is the bytecode format used by on-chain programs with Solana. You can find some more info at the links contained within https://docs.solana.com/developing/on-chain-programs/overview#berkeley-packet-filter-bpf

1
  • No luck unfortunately... ➜ test1 anchor build BPF SDK path does not exist: /Users/herbie/.cargo/bin/sdk/bpf: No such file or directory (os error 2) ➜ test1 solana -V solana-cli 1.9.1 (src:b66e2ae3; feat:4100269022) ➜ test1 cargo build-bpf BPF SDK path does not exist: /Users/herbie/.cargo/bin/sdk/bpf: No such file or directory (os error 2) Feb 2, 2022 at 10:12
0

Try removing the solana cache before running your code. It worked for me. Basically, the BPF SDK hasn't been installed accurately.

rm -rf ~/.cache/solana/*

After deleting the solana cache run. It should download the BPF SDK again

solana build

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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