Skip to main content

Questions tagged [build-sbf]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
9 views

Title: Unable to Build Anchor Project with SBF Tools: Issues with sbf-solana, bpfel-unknown-none, and Docker Compatibility

Description: Hello everyone, We’ve been struggling for hours trying to build an Anchor project on Solana. Despite numerous attempts, nothing seems to work, either locally or using Docker. Below are ...
Marc romano's user avatar
1 vote
1 answer
41 views

How to solve the cargo build-sbf error?

I have just started with rust and solana. Firstly, I created a solana program using the command: cargo init hello_world --lib everything ran fine, and then i read from the official docs, to build i ...
Saniddhya Dubey's user avatar
0 votes
1 answer
45 views

Error in building project with Anchor

Hello and thanks for your help in advance! I am having an issue building my project, here is the background: Fedora Linux v.39 rustc 1.78.0 solana-cli 1.18.24 (src:6b04e881; feat:3241752014, client:...
David's user avatar
  • 1
1 vote
1 answer
31 views

Face error while install target sbf-solana-solana

I was trying to add target sbf-solana-solana by the command\ rustup target add sbf-solana-solana but i am facing as issue error: toolchain 'stable-x86_64-unknown-linux-gnu' does not support target '...
Saksham jain's user avatar
1 vote
1 answer
30 views

What can I do about sbf.mk Makefile include seeming to be incompatible with solana_sdk.h within the solana repository?

I am just getting started with Solana development. I am a C programmer so I am most comfortable with C. I am just using the most basic code to create a shared object file. I am on Ubuntu 22 x86-64. ...
someone serious's user avatar
3 votes
1 answer
342 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
2 votes
3 answers
2k 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
  • 2,734
1 vote
1 answer
205 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
17 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
74 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
30 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
516 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
2k 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
  • 19.6k
0 votes
1 answer
499 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
1 vote
1 answer
75 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
536 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
  • 432
2 votes
0 answers
74 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,373
4 votes
3 answers
153 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
226 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
  • 1,062
2 votes
1 answer
928 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
  • 2,734
4 votes
2 answers
4k 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
  • 465