Skip to main content

Questions tagged [build-bpf]

The tag has no usage guidance.

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

Missing `convert_endianness` in module `solana_program::alt_bn128::compression::prelude`

I am attempting to utilize altbn254 syscalls with Solana (1.17.14), but cannot compile due to an unresolved import of convert_endianness. This is my cargo.toml [package] name = "program" ...
all_ducks_quack's user avatar
1 vote
1 answer
99 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
0 votes
0 answers
21 views

problem building new project

Hello i have Apple M2 Pro, with a local solana-test-validator running. I created new wallet and i can airdrop sol and check my balance. solana-cli 1.17.25 rustup 1.27.1 (54dd3d00f 2024-04-24) info: ...
Max Dev3's user avatar
1 vote
0 answers
87 views

cargo build-bpf doesnt work

and error message is error: package solana-program v1.18.11 cannot be built because it requires rustc 1.75.0 or newer, while the currently active rustc version is 1.72.0-dev Either upgrade to rustc 1....
아이고사장님'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
5 votes
2 answers
119 views

What's the benefit of using platform-tools compared to Rust's upstream bpfel-unknown-none target?

The fact that Solana's CLI installer shipped (and still ships) with a nearly year-long outdated version of platform-tools has been a pain point with the previous Solana team I've worked with. platform-...
ARitz Cracker's user avatar
1 vote
1 answer
247 views

"package solana-program v1.18.7 cannot be built" error [duplicate]

I have a new Rust project that gives the following error when I compile it. package `solana-program v1.18.7` cannot be built because it requires rustc 1.72.0 or newer, while the currently active rustc ...
mezzosoprano's user avatar
0 votes
0 answers
38 views

libssl.so.1.1 is installed but Anchor doesn't detect it on Fedora Linux

I tried installing libssl.so.1.1 using sudo dnf install libssl.so.1.1, and I can clearly see it is installed (as shown in the screenshow above). However Anchor is still not able to detect it. Most of ...
Syed Aabis Akhtar's user avatar
0 votes
1 answer
82 views

error: Unable to update registry `crates-io` while cargo build-bpf

I just started learning solona. And following the solana guide while learning Cargo build-bpf, i am getting following error on wsl 2, Debian biplab@BIPLAB:/mnt/d/Rust/rust_project/solana$ cargo build-...
Biplab Mochan Gartia's user avatar
1 vote
2 answers
462 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
  • 16.4k
1 vote
1 answer
103 views

cargo build-bpf failed

When I execute the command cargo build-bpf, I encounter an error. How can I resolve this issue? error: target is not supported, for more information see: https://docs.rs/getrandom/#unsupported-targets ...
zhxx zh's user avatar
  • 81
0 votes
1 answer
353 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
320 views

Error: Unable to open program file: No such file or directory (os error 2)

I am trying to deploy a hello world program on the blockchain through the solana cli. I tried running cargo build-bpf , after running the program the deploy directory is not downloaded so that I can ...
Shivang Rawat's user avatar
0 votes
0 answers
68 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
  • 145
1 vote
1 answer
64 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
4 votes
3 answers
141 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
154 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
  • 958
1 vote
1 answer
376 views

Anchor Build Error: failed to select a version for the requirement `aho-corasick = "^1.0.0"

error: failed to select a version for the requirement `aho-corasick = "^1.0.0"` candidate versions found which didn't match: 0.7.20, 0.7.19, 0.7.18, ... location searched: crates.io index ...
Roshan Wazare's user avatar
0 votes
2 answers
167 views

Error when running npm run build:program-rust on helloworld example

I'm new to solana developing and am trying to run the hello world example. I am getting the following error after running npm run build:program-rust and am not sure how to fix it. What is causing this ...
xkycc's user avatar
  • 99
3 votes
1 answer
234 views

Why does rebuilding programs with `cargo build-bpf` take so long in a workspace?

Compared to the normal cargo build --release --workspace, rebuilding a program with cargo build-bpf (or sbf) ends up redoing quite a bit of work. If you have already built the workspace using cargo ...
Sammy's user avatar
  • 168
1 vote
1 answer
89 views

Issue building program via Cargo build-bpf

Getting an error during Build process with cargo build-bpf on Hello World program. error: linker cc not found | = note: No such file or directory (os error 2)
Solanadev's user avatar
1 vote
1 answer
87 views

How to compile a program on a Raspberry Pi?

I'm trying to get up and running with Solana development and was hoping I could use my Raspberry Pi to do all my dev work (not a requirement, just an experiment). I've been following the tutorial ...
jeffersonbenson's user avatar
1 vote
1 answer
269 views

'version OPENSSL_1_1_1 not found' error when running 'cargo build-sbf' on linux

I consistently get this error message when running cargo build-sbf or cargo build-bpf: Warning: cargo-build-bpf is deprecated. Please, use cargo-build-sbf cargo-build-bpf child: /home/anish/.local/...
Anish De's user avatar
2 votes
2 answers
835 views

Increase Deployed Program Account Allocation

I have deployed a program which got allocated 41216 bytes for the program account. I have changed this program, and would like to redeploy. However, the changed program is 46984 bytes. Error: ...
Sky020's user avatar
  • 147
0 votes
2 answers
115 views

Verifying that a program on chain is really running the code claimed

let's say I have been sent a link to a git repo that the owner says contains the code that a particular program is running. I can pull the repo and compile the program, but do any tools exist that ...
daoplays's user avatar
  • 587
1 vote
1 answer
137 views

Error compiling async-executor with "cargo build-sbf"

I got this: abcdedf@WudeMacBook-Pro golana % cargo -V cargo 1.63.0 (fd9c4297c 2022-07-01) abcdedf@WudeMacBook-Pro golana % solana -V solana-cli 1.11.10 (src:843e018c; feat:4253057308) abcdedf@...
oxfeeefeee's user avatar
3 votes
3 answers
617 views

Anchor Error, Refuses to build and deploy

I was downgrading and upgrading my Solana and anchor versions in order to deploy my programs to devnet. And while doing that after a time my anchor broke. I removed the rust and re-installed it and ...
SolanaDev's user avatar
1 vote
0 answers
59 views

RUSTFLAGS="-C instrument-coverage" with solana program [closed]

Trying to add check coverage, when using RUSTFLAGS="-C instrument-coverage" cargo build-bpf I'm getting: error: failed to run `rustc` to learn about target-specific information Caused by: ...
Ohad Dahan's user avatar
0 votes
1 answer
320 views

Can't compile after upgrading from 1.10.. to 1.11

I upgraded my solana tools and running cargo build-sbf, cargo-build-sbf or cargo build-bpf results in the following error (Ubuntu 20.04): example-helloworld/src/program-rust$ cargo build-sbf error: no ...
448-OG's user avatar
  • 3
2 votes
1 answer
247 views

solana-test-validator "Illegal instruction" mac M1

When I run solana-test-validator I get Job 1, 'solana-test-validator' terminated by signal SIGILL (Illegal instruction) Configuration: Mac m1 12.1 cargo 1.62.1 (a748cf5a3 2022-06-08) rustup 1.25.1 (...
vicyyn's user avatar
  • 4,115
7 votes
2 answers
379 views

On-chain size of Anchor programs

I noticed that a minimal Anchor Program, e.g. this here takes up over 400kB of executable data on the blockchain. I checked another, a bit more elaborate program, and it's taking up 800kB. Given all ...
AllBlooming's user avatar
  • 2,269
2 votes
1 answer
823 views

What is cargo build-bpf?

The solana-program-library says to build apps with cargo build-bpf yet if you look at cargo --help this is not mentioned as a valid argument. How does cargo know to look at BPF SDK: /home/phil/...
Philip Rego's user avatar