Skip to main content

Questions tagged [rustc]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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
1 vote
1 answer
40 views

Anchor build says "cannot be built because it requires rustc 1.75.0 or newer" I have rustc installed 1.82.0

Anchor Verification Issue: Rustc Version Mismatch in Docker Environment Command Executed anchor verify 3MRKmmRZ6Fm4tvEEjBZcuGG7nxWVSYCJd83WzmAGqm8J Problem Summary The program build fails due to a ...
Jahanzeb Hussain's user avatar
2 votes
1 answer
25 views

which versions of Solana SDK and Anchor are compatible with the stable toolchain.?

which versions of Solana SDK and Anchor are compatible with the stable toolchain.? It appears that the current nightly toolchain you are using (nightly-x86_64-unknown-linux-gnu) does not support the ...
Mah Bago's user avatar
2 votes
1 answer
40 views

How do you get the Solana platform tools version? Or the `rustc` version used by Solana to compile programs?

When building a Solana rust program, it does NOT use your normal system's rust compiler (rustc), instead cargo build-sbf uses the Solana "platform tools" under the hood which ships a ...
nickfrosty's user avatar
  • 1,199
0 votes
0 answers
49 views

Anchor - Stuck with error SendTransactionError

I have been trying to write some custom contract in solana using Rust but always ending up with below error: Catch the SendTransactionError and call getLogs() on it for full details. at Connection....
Vishnu Vardhan Vanga's user avatar
0 votes
0 answers
222 views

Mempool transaction Stream

I want to listen to the Solana mempool for a MEV bot. I was checking out Jito for this purpose, but it appears to be deprecated. How can I listen to the mempool transaction information on Solana now ...
Bobz's user avatar
  • 574
2 votes
1 answer
54 views

Solaan transaction delay

Is there any way that after a wallet signs a transaction I can delay the transaction from actually going through until I call a function or is this not possible, also open to work arounds. Thanks in ...
Jaqjeet's user avatar
  • 21
1 vote
1 answer
103 views

solana contract rust error anchor build

use anchor_lang::prelude::*; use anchor_spl::token::{self, Mint, Token, TokenAccount, Transfer, MintTo}; declare_id!("GTPh1tdHiMWVj3yBj2S2ZZftuLPEWPyQZ6Cy7g5ibM5K"); #[program] pub mod puj { ...
proyectosdev0623 xxx's user avatar
0 votes
0 answers
22 views

Getting error that I am using an older version of rust, but --version shows I am using latest

Although my Rust is version 1.78.0 I constantly am getting this error when I do an anchor build: error: package toml_edit v0.21.1 cannot be built because it requires rustc 1.69 or newer, while the ...
Hossein Jalali's user avatar
2 votes
2 answers
136 views

keep getting this error on a fresh ubuntu 24 lts, although my rustc version is 1.78.0

error: package solana-program v1.18.14 cannot be built because it requires rustc 1.75.0 or newer, while the currently active rustc version is 1.68.0-dev Either upgrade to rustc 1.75.0 or newer, or use ...
Cobra's user avatar
  • 21
1 vote
1 answer
216 views

I am getting a compile error: target not supported when trying to compile Solana hello world smart contract

So I'm trying to compile my first Solana smart contract. It's this hello world smart contract: https://github.com/solana-labs/example-helloworld Here is my rustc and cargo version: candid@DESKTOP-...
Mark's user avatar
  • 45
3 votes
0 answers
21 views

Anchor Test fails with version error [duplicate]

Issue: I installed everything needed to start developing on Solana. I am trying to test a simple contract but when i run: anchor test, it errors out the following: error: package `solana-program v1.18....
Dutch's user avatar
  • 31
5 votes
2 answers
211 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
294 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
2 votes
1 answer
514 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
0 answers
94 views

cargo build-bpf package error: `ahash v0.8.8` cannot be built because it requires rustc 1.72.0 or newer

I'm using a simple hello world solana program from https://moralis.io/how-to-write-a-solana-smart-contract src/lib.rs use solana_program::{ account_info::AccountInfo, entrypoint, ...
A. K.'s user avatar
  • 195
4 votes
1 answer
3k views

error: package `solana-program v1.18.1` cannot be built because it requires rustc 1.72.0 or newer [duplicate]

I tried setting up an Anchor project on my MacBook with an ARM processor, but I encountered an error. Here is step by step that i took % anchor init testproject Only x86_64 / Linux distributed in NPM ...
Quoc Le's user avatar
  • 41
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
3 votes
4 answers
1k views

Anchor compatibility issues

Whenever I try to run anchor build, I am greeted with a package incompatibility error, saying that my rustc toolchain version is too low (1.62.0-dev) but my toolchain is set to 1.75.0. Here's the ...
Morgandril's user avatar
0 votes
3 answers
948 views

Is it possible to have reflection tokens like safemoon on solona?

A reminder on how reflection tokens like safemoon work is every ones balance is simply an equation instead of a fixed number. That way everyone's balance can be instantly updated with no gas needed ...
OPP's user avatar
  • 11
1 vote
1 answer
242 views

Can anyone use SolGSN: Solana Gas Station?

I want to use SolGSN, where the user can't pay the gas fee like transferring the NFT. The admin has to pay the fee. However, this repository is outdated, and I've encountered several errors due to ...
Bobz's user avatar
  • 574
3 votes
1 answer
482 views

How to get Mint Address of of SPL token using associated token account? without rpc call

I can get an associated token account knowing the mint address and wallet address with spl_associated_token_account::get_associated_token_address function But is it possible to get a mint address, ...
Scott's user avatar
  • 33
2 votes
1 answer
471 views

solana play ground - too much SOL for initial deployment and RPC error

I'm trying to deploy some program locally with solana playground, when trying to deploy the program on dev-net the initial deployment costs 4.40 SOL, and when requesting more than 1 SOL(with "...
OrHaifler's user avatar
2 votes
2 answers
793 views

cargo build-bpf rustc version

I'm trying to use "cargo build-bpf" on a simple rust file, I'm using the "solana_program" dependency and the next error occurs: "error: package solana-program v1.16.5 cannot ...
OrHaifler's user avatar
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
11 votes
5 answers
8k views

Anchor build says "cannot be built because it requires rustc 1.68.0 or newer" but I have a newer rustc installed

When I run anchor build or anchor test: error: package `solana-program v1.16.3` cannot be built because it requires rustc 1.68.0 or newer, while the currently active rustc version is 1.62.0-dev. But ...
hoho hotstuff's user avatar
1 vote
1 answer
1k views

update rustc that anchor uses

After running cargo build-bpf I get the following error: cargo-build-bpf child: rustup toolchain list -v cargo-build-bpf child: cargo +bpf build --target bpfel-unknown-unknown --release error: package ...
user4309's user avatar
3 votes
3 answers
2k views

InstructionFallbackNotFound. Error Number: 101. Error Message: Fallback functions are not supported

Have a question related to custom program development. I've testing this program pub mod fluxtility { use super::*; pub fn buy_ticket(ctx: Context<Initialize>, lamports: u64) -> ...
Muhit Raihan's user avatar
1 vote
2 answers
266 views

How do pass Context into multiple helper functions?

sorry if this is a more rusty question. As the title suggests, how can I pass the context struct into multiple helper functions? What I'd like to do is something like this: impl<'info> BuyIn<'...
TLS's user avatar
  • 65
2 votes
1 answer
173 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
2 votes
2 answers
2k 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
5 votes
1 answer
375 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
1 vote
1 answer
348 views

Issues with installing solana on m1 mac book (macOS Monterey v12.6)

Followed guide https://dev.to/0xmuse/install-solana-on-m1-macs-without-rosetta-10m5 to install solana as I was reading about issues installing with rosetta. But after running ./scripts/cargo-install-...
user2271's user avatar
3 votes
3 answers
606 views

could not find `__client_accounts_contributor` in the crate root

Attempting to 'anchor build' a project and running into errors with the #[program] macro. Unsure exactly what could be causing these. Tried reading the compiler error index but it didnt seem to help ...
Joey Meere's user avatar
  • 1,612
1 vote
0 answers
77 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