Skip to main content

Questions tagged [build-sbf]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
33 views

bug? anchor build got error: `Stack offset of 4608 exceeded max offset of 4096 ...` if there is v1.18.10 solana, but v1.16.25 is OK

Question1: anchor build got error: Stack offset of 4608 exceeded max offset of 4096 ... if let solana v1.18.10 present in ENV/PATH ❱❱❱ which solana /mnt/volume2/solana_dev_env/v1.18.10/solana-release/...
breeze wang's user avatar
1 vote
2 answers
134 views

anchor build fails with 'no such command: `build-sbf`', but I can see build-sbf is installed

I've installed Rust, Solana 1.18 (currently in beta) and Anchor 0.30. On a new project: anchor init project cd project anchor build fails with: error: no such command: `build-sbf` View all ...
mikemaccana's user avatar
  • 1,962
1 vote
1 answer
43 views

New project with no code changes, cargo build-sbf resulting in many (44) errors

I created a new project, with cargo init project --lib. I added these dependencies: solana-program = "1.18.11" solana-client = "1.18.11" solana-sdk = "1.18.11", ran cargo ...
user12678's user avatar
1 vote
0 answers
15 views

cargobuild fails,both sbf and bpf doest work,no such command: +solana Cargo does not handle `+toolchain` directiv mean toinvoke`cargo` through`rustup` [duplicate]

i tried using cargo-build-sbf after failing with bpf , howvere i get the same error anirudh@kiaraki:~/hello_world$ cargo build-bpf error: no such command: +solana Cargo does not handle `+toolchain`...
Anirudh Anirudh's user avatar
2 votes
1 answer
33 views

How to check if a crate on solana and anchor repo can be used on-chain or off-chain?

This question has hanging over my head for long time. How to tell a crate provided by solana org or third party can be imported and use from on-chain code? Is there any flag in cargo.toml file to tell ...
breeze wang's user avatar
0 votes
0 answers
26 views

cargo build-sbf no such command: `+solana` [duplicate]

$ cargo build-sbf info: uninstalling toolchain 'solana' info: toolchain 'solana' uninstalled error: no such command: '+solana' Cargo does not handle `+toolchain` directives. Did you mean to ...
Oliver373's user avatar
1 vote
2 answers
392 views

package `bumpalo v3.15.2` cannot be built because it requires rustc 1.73.0 or newer, while the currently active rustc version is 1.72.0-dev

package bumpalo v3.15.2 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 -...
MANTOSH KUMAR's user avatar
6 votes
1 answer
968 views

How do I fix "package solana-program v1.18.0 cannot be built because it requires rustc 1.72.0 or newer"?

When building an onchain program with cargo build-sbf using solana-program v1.18, I get the following error: error: package solana-program v1.18.0 cannot be built because it requires rustc 1.72.0 or ...
Jon C's user avatar
  • 14.4k
0 votes
1 answer
259 views

Rust build fails - cannot find libssl.so

The build fails due to error /home/dev/.rustup/toolchains/bpf/bin/cargo: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory OpenSSL and ...
Wilfred Almeida's user avatar
0 votes
0 answers
63 views

Anchor only solana build error ( fine with cargo )

When I compile my code with cargo build-sbf or cargo test-sbf I get no issues. But when I build with anchor build I get error[E0432]: unresolved import `crate::sys::IoSourceState` --> src/...
Trevor's user avatar
  • 115
1 vote
1 answer
55 views

Bad CPU type in executable

Problem I have a problem on build Rust Solana contract on processor M1. I used a simple example hello world. use solana_program::{ account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, ...
Ivan's user avatar
  • 11
5 votes
3 answers
289 views

How do you disassemble Solana programs?

Basically, what the title says. Since SBF != eBPF, the eBPF disassemblers don't work. When I try $ solana-ledger-tool program disassemble foo.so it complains about me not having a ledger folder or a ...
Proph3t's user avatar
  • 412
2 votes
0 answers
53 views

How to debug and resolve crashes of cargo-build-sbf?

It is possible to cause a crash of cargo build-sbf For instance https://github.com/shepmaster/twox-hash disabling the default feature "std": cargo build-sbf crashes with rustc --crate-name ...
Arowana's user avatar
  • 2,233
4 votes
3 answers
136 views

Unable to build a binary

Both anchor build and cargo-build-sbf throw: Warning: cargo-build-bpf is deprecated. Please, use cargo-build-sbf cargo-build-bpf child: /Users/usr1/solana/bin/cargo-build-sbf --arch bpf error: package ...
mega_creamery's user avatar
2 votes
1 answer
124 views

Is there a way to configure an Anchor project to use the `--arch sbf` flag without having to specify it with each command?

After creating a new Anchor project, when you do anchor build you will see this warning: Warning: cargo-build-bpf is deprecated. Please, use cargo-build-sbf After looking into the cargo build ...
beeman's user avatar
  • 950
2 votes
1 answer
641 views

What does 'SBF', as in 'SBF program' stand for?

From https://docs.solana.com/developing/intro/programs: Programs are considered stateless since the primary data stored in a program account is the compiled SBF code From solana program dump -u m ${...
mikemaccana's user avatar
  • 1,962
3 votes
2 answers
3k views

'error: not a directory' when running cargo build-sbf

Recently, I was trying to build the spl-governance program locally, but since I had solana v1.10.39, it seemed to fail since it didn't support cargo build-sbf (build-bpf is deprecated) I then updated ...
sayantank's user avatar
  • 425