Rust Toolchains and how to update them
I’m trying to write a Solana program in native rust using the solana-program crate (currently in version 2.1.6)
However, whenever i run
cargo build-sbf
it give me the following error:
error: package
solana-program v2.1.6
cannot be built because it
requires rustc 1.79.0 or newer, while the currently active rustc
version is 1.75.0-dev
I know that it’s not using my active rust tool chain (that’s up to date) but it creates a separate “solana” toolchain. However, even if I set that as the active one and update it, it doesn’t seem to fix my issue.
I’ve uninstalled and reinstalled everything from my local rust versions to the agave cli. Can’t get rid of this error.
I temporarily fixed it by using solana-program is version 1.18 but that’s not a long-term solution.
Could somebody please explain to me how those rust toolchains work, when exactly the “solana” toolchain is added, which script is responsible for that, and how i can update the rustc of that toolchain to a newer version.
Thanks 🙂
Responses