Questions tagged [cargo]

The tag has no usage guidance.

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

Error building Solana program: "package `bumpalo v3.15.3` cannot be built because it requires rustc 1.73.0 or newer

I am encountering an error while trying to build a Solana program using cargo build-sbf. Here is the error message I received: info: uninstalling toolchain 'solana' info: toolchain 'solana' ...
Vinay Sawant's user avatar
0 votes
1 answer
40 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
0 votes
1 answer
15 views

Cannot compile `solana-program` crate with new `sqlx` versions

For some reason when trying to compile a project having both sqlx and solana-program I get an error on package version mismatches, which is strange, because those should come from different crates and ...
RowanStone's user avatar
0 votes
1 answer
17 views

solana$ ./cargo test => "error: test failed, to rerun pass `-p solana-cli --test program`" : arguments passed solve nothing

I have a problem when testing the solana chain. I successfully built the solana repo, but after if i do a ./cargo test, i fall on this error: error: test failed, to rerun pass `-p solana-cli --test ...
DavisX's user avatar
  • 3
0 votes
1 answer
82 views

solana$ ./cargo build => "error: linking with `cc` failed: exit status: 1"

I try to install the Solana chain locally but when I execute the ./cargo build command, i fall on this fail: error: linking with `cc` failed: exit status: 1 But if I do a ./cargo build --release i ...
DavisX's user avatar
  • 3
0 votes
1 answer
44 views

Please help me. I have tried everything and installed the latest environment. Why is this problem still happening?

cargo build-bpf info: uninstalling toolchain 'solana' info: toolchain 'solana' uninstalled error: no such command: +solana Cargo does not handle `+toolchain` directives. Did you mean to invoke ...
aaaak's user avatar
  • 11
0 votes
2 answers
42 views

cargo build-bpf in a sandbox environment

Based on the docs in order to compile the sample application, we need to use cargo build-bpf. Unfortunately this tool attempts to access the internet in order to download the platform tools. Are there ...
Arijoon's user avatar
  • 103
1 vote
1 answer
29 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
  • 71
1 vote
1 answer
105 views

The trait `borsh::de::BorshDeserialize` is not implemented for `T` problem

Im trying to compile in rust a code to mint a candy machine directly, but after I put the dependecies in Cargo.toml it still giving me this error. My Cargo.toml: [package] name = "mint_project&...
Xambras's user avatar
  • 11
1 vote
2 answers
276 views

cargo build-bpf no such command: `+solana` running build:program-rust

Ran the code npm run build:program-rust getting this error I've tried uninstalling and reinstalling rustup and also solana tool chain still nothing [email protected] build:program-rust cargo build-bpf ...
Henry Duru's user avatar
0 votes
1 answer
98 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
3 answers
1k views

cargo build-bpf no such command: `+solana`

I used the official documentation. Install the latest Rust stable from https://rustup.rs/ . Install the latest Solana command-line tools. But when i try cargo build-bpf in command line in windows 10 i ...
Leo Loki's user avatar
  • 362
0 votes
1 answer
63 views

Cannot perform a CPI call using anchor

I tried to make a CPI call from puppret_master to puppet program exactly like the anchor document and i did everything right but "program" AND "cpi" keywords are still unkown for ...
pooria sarkhan's user avatar
0 votes
0 answers
48 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
  • 83
4 votes
3 answers
112 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
3 votes
4 answers
553 views

Error when anchor build - package `constant_time_eq v0.3.0` cannot be built

I'm trying to build using anchor but there seems to be this error error: package `constant_time_eq v0.3.0` cannot be built because it requires rustc 1.66.0 or newer, while the currently active rustc ...
AlexDragon's user avatar
0 votes
1 answer
135 views

failed to complete: Instruction passed to inner instruction is too large (12884932868 > 1280)

I am trying to optimize size of my code by moving logic to freeze and approve in a separate file. However when I deploy and try to call my contract, I am getting error: 'Program ...
Piyush Chittara's user avatar
0 votes
2 answers
2k views

WSL_Ubuntu: 'hello-solana': error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

I have seen much around this libssl.so.1.1 issue but no resolution so starting a new thread. Does anyone have line of sight into this issue? I have attempted all suggested fixes in related posts ...
verystochastic's user avatar
3 votes
1 answer
172 views

Getting error while compiling the program

Hey I am facing this error error[E0658]: let...else statements are unstable --> /home/asus/.cargo/registry/src/github.com-1ecc6299db9ec823/solana-frozen-abi-macro-1.16.0/src/lib.rs:422:5 | ...
Pankaj's user avatar
  • 51
4 votes
3 answers
541 views

Error when anchor build - package `toml_datetime v0.6.2` cannot be built

I'm trying to build using anchor but there seems to be this error error: package `toml_datetime v0.6.2` cannot be built because it requires rustc 1.64.0 or newer, while the currently active rustc ...
BHappy's user avatar
  • 43
0 votes
0 answers
35 views

Anchor build error: cannot find version of aho-corasick dependency

I am having trouble building my Anchor project. I first got the error message "cargo pbf require libssl1.0.0". I installed the dependency libssl1.0.0 with the command sudo nano /etc/apt/...
solana dev's user avatar
0 votes
0 answers
49 views

Getting error while running cargo build-bpf

I was trying to compile this contract but ended up getting this error Error Error: Function ZN14solana_program4vote5state9VoteState11deserialize17hdfad8c2762e760a5E Stack offset of 6344 exceeded max ...
Hitesh Garg's user avatar
2 votes
1 answer
817 views

libssl.so.1.1 not found when running anchor test in Kali Linux [duplicate]

I'm getting the following messages and error when running anchor test in Kali Linux: anchor test BPF SDK: /home/...
Lano's user avatar
  • 153
1 vote
1 answer
105 views

Anchor: How to know instruction number without having to run "cargo expand"?

I have a Tic Tac Toe game contract which looks like this: #[program] pub mod tic_tac_toe { use super::*; pub fn start_game(ctx: Context<StartGame>) -> Result<()> { ...
Sasha Shpota's user avatar
1 vote
1 answer
34 views

Why can't the Solana validator code base be built with its own tooling?

I am at commit 67d3beeb35e62b8a04b1e511a5917a205db622df. Recent rustup has installed rustc 1.67.0 (fc594f156 2023-01-24), and cargo 1.67.0 (8ecd4f20a 2023-01-10). However, the version of rustc and ...
Zantetsu's user avatar
  • 136
0 votes
1 answer
24 views

Cargo complaning about unmatchable version requirements, even though matching versions exist

I'm trying to run anchor build on a workspace and receiving errors about a supposedly unmatchable version requirement for the crate "time", even though matching versions exist locally: As ...
Xhan's user avatar
  • 3
2 votes
1 answer
114 views

Depencencies in Cargo.toml file Solana-SDK and Solana-Client doesn't work

Hello I am trying desperately to use solana-sdk and solana-client but when I do cargo build-bpf it doesn't work. Can someone help me please? When I use only solana-client as a dependency the ...
RevOneX9's user avatar
1 vote
1 answer
89 views

Solana-SDK and Solana-Client doesn't work as a dependencies

Hello I am trying desperately to use solana-sdk and solana-client but when I do cargo build-bpf it doesn't work. Can someone help me please? If I specify only solana-client and solana-sdk, I get this ...
RevOneX9's user avatar
1 vote
1 answer
286 views

`Anchor build`: failed to select a version for the requirement `rust_decimal = "..."

Both anchor build and cargo build-bpf fail with: BPF SDK: /home/fish/.local/share/solana/install/releases/1.9.29/solana-release/bin/sdk/bpf cargo-build-bpf child: rustup toolchain list -v cargo-build-...
Whiteseal's user avatar
  • 2,592
2 votes
2 answers
865 views

Solana Helloworld example stuck on cargo build bpf without error message

I'm in the process of deploying the Solana helloworld example smart contract on Ubuntu 20.04. When running npm run build:program-rust, the package.json in the root of the repository states that this ...
Ryan Wennekes's user avatar
4 votes
1 answer
153 views

Solana Program 1 time initialization Issue

I want to add a check that once a function is called it should never be called again. I want initialization to be one-time only. Is this a good approach if I take a bool value and set it to false ...
Abdullah Qureshi's user avatar
6 votes
1 answer
149 views

How to use Tuples in Anchor lang

What am I doing wrong? Is that not how we use tuples in rust? Account: #[account] pub struct UserLedger { pub list: Vec<(String, u32)>, } Error Message: Error: Type not found: {"type&...
Abdullah Qureshi's user avatar
6 votes
2 answers
188 views

How to merge 2 or more Transactions and ask for 1 time payment only

Edited: I want to merge the following 2 Transactions. Not sure if it will be done from the front-end or in the rust program. Transaction 1 -> Mint NFT token: Transaction 2 -> Collect NFT in ...
Abdullah Qureshi's user avatar
6 votes
2 answers
250 views

Error Code: AccountDidNotSerialize. Error Number: 3004. Error Message: Failed to serialize the account

I am trying to update value of string. I can update if its type is u8, u32, u64, or i64 but cannot update if it's a string type. Any guesses what am I doing wrong? Code snippet: Program Function ...
Abdullah Qureshi's user avatar
4 votes
1 answer
576 views

Add timestamp to current time

I need to implement a time-bound function to get the current_time and set an end_time The function should add add_time to the current_time let's say 2 years, 3 months and 4 days if add_time in UTC is ...
Abdullah Qureshi's user avatar
1 vote
0 answers
25 views

I have downloaded solana and rust and am trying to anchor build a project and keep getting this message

error[E0635]: unknown feature proc_macro_span_shrink --> /Users/arslandin/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.47/src/lib.rs:92:30 | 92 | feature(proc_macro_span, ...
Arslan's user avatar
  • 11
1 vote
3 answers
2k views

Cannot build - unknown feature `proc_macro_span_shrink`

I've started to learn Solana and I'm on the very beginning. When running cargo build-bpf, I get an error like this: error: could not compile `crossbeam-epoch` Caused by: process didn't exit ...
pzmn's user avatar
  • 11
1 vote
1 answer
50 views

unable to get packages from source

warning: please specify `--format-version` flag explicitly to avoid compatibility problems error: failed to download `lock_api v0.4.9` Caused by: unable to get packages from source Caused by: ...
Mateo Lafalce's user avatar
1 vote
1 answer
55 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
230 views

`cargo build-sbf` doesn't work 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
3 votes
2 answers
423 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
3 answers
305 views

"cargo-build-bpf" Bad CPU type in executable

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-...
Daksh M.'s user avatar
  • 111
1 vote
1 answer
191 views

Anchor Build Depenedency error

I am trying to compile an anchor package and whenever I type anchor build or cargo build-bpf get this error - **error: not a directory: '/Users/madhavgoyal/.local/share/solana/install/releases/1.10.31/...
Madhav Goyal's user avatar
1 vote
1 answer
408 views

the trait `anchor_lang::AccountSerialize` is not implemented for `Requester

The Requester struct looks like this #[account(zero_copy)] pub struct Requester { pub authority: Pubkey, pub oracle: Pubkey, pub created_at: i64, pub count: u64, pub last_updated: ...
Icus1's user avatar
  • 441
2 votes
1 answer
458 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
1 vote
1 answer
517 views

`anchor build` fails with error, "failed to load manifest for workspace member"

I tried some stuff with anchor today but I kept running into issues. I couldnt find a solution for this besides using wsl: PS E:\Programming\solana\mysolanaapp> anchor build Failed to obtain ...
Pum's user avatar
  • 23