Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Outdated Rust version causes MSRV compile error #33504

Open
acheroncrypto opened this issue Oct 3, 2023 · 17 comments
Open

Outdated Rust version causes MSRV compile error #33504

acheroncrypto opened this issue Oct 3, 2023 · 17 comments
Labels
community Community contribution

Comments

@acheroncrypto
Copy link
Contributor

Problem

$ cargo-build-sbf --version
solana-cargo-build-sbf 1.17.0
platform-tools v1.37
rustc 1.68.0

The latest Solana tools(1.17.0) comes with rustc 1.68.0 which is ~5 releases behind the stable Rust release. This causes problems when a crate bumps their MSRV, which was especially prevalent with the 1.14 release given how behind it got from the stable Rust release.

Example of a confusing MSRV error:

error: package `winnow v0.4.4` cannot be built because it requires rustc 1.64.0 or newer, while the currently active rustc version is 1.62.0-dev

Another related issue is the discrepancy between the repo's Rust version and the version which version gets released with the build tools. #31960 (comment) is a good example of how things could go wrong.

Proposed Solution

Update Rust version to the stable Rust version before publishing a new minor Solana release.


Related: anza-xyz/rust#85, #31528, #32361

@acheroncrypto acheroncrypto added the community Community contribution label Oct 3, 2023
@mvines
Copy link
Member

mvines commented Oct 3, 2023

@dmakarov i typically upgrades the sbf rust version, not sure when he's next planning to pull in the latest rust stable

@dmakarov
Copy link
Contributor

dmakarov commented Oct 3, 2023

I work on updating platform-tools to rust 1.72. Current plan is to release updated platform-tools by the end of this week, but it may take longer.

danenbm added a commit to metaplex-foundation/mpl-bubblegum that referenced this issue Jan 3, 2024
* Release process downgrades borsh to 0.9.3
* Ran cargo update -p [email protected] --precise 0.8.6 to rebuild
to overcome solana-labs/solana#33504
@beeman
Copy link
Contributor

beeman commented Jan 6, 2024

I work on updating platform-tools to rust 1.72. Current plan is to release updated platform-tools by the end of this week, but it may take longer.

Hi @dmakarov! Would it be possible to prioritize this update? It seems to break new anchor apps as described in this issue.

@dmakarov
Copy link
Contributor

dmakarov commented Jan 6, 2024

I work on updating platform-tools to rust 1.72. Current plan is to release updated platform-tools by the end of this week, but it may take longer.

Hi @dmakarov! Would it be possible to prioritize this update? It seems to break new anchor apps as described in this issue.

The update has been finished long ago and released as platform-tools v1.39. https://github.com/solana-labs/platform-tools/releases/tag/v1.39

@acheroncrypto
Copy link
Contributor Author

The update has been finished long ago and released as platform-tools v1.39. https://github.com/solana-labs/platform-tools/releases/tag/v1.39

It has been finished but the problem still remains because the latest stable Solana tools release(1.17.14) defaults to v1.37.

Why not just use the latest platform-tools version e.g. cargo-build-sbf --tools-version v1.39? Quoting from #31960 (comment),

Releases are coordinated with a certain version of the Rust compiler, and it is dangerous to encourage mixing crate and Rust versions in any capacity.

Given mixing crate and Rust versions has caused problems in the past, what other options do people have other than forking or downgrading crates?

@FrackinFamous
Copy link

FrackinFamous commented Jan 27, 2024

This is still an issue what like a year later. Spent three hours yesterday, hating every minute of it. Was not a fun brick wall to hit 20 minutes into learning about Solana and rust. Spun up a server in 3 seconds. Cussed this tutorial for three hours and could care less about starting back at it today. Why not delete the tut if it doesn't work for a year. So frustrating because I was very excited.

@ShibtBryce
Copy link

LOL same here. Been on this for 3-4 hours now and about to give up

@FrackinFamous
Copy link

LOL same here. Been on this for 3-4 hours now and about to give up

Hit me up in a bit and we'll figure it out. 3 hours last night and 3 this morn. I'll be back at it in a bit. I'm going to try in a Dev container when I get home.

Did you ever have rust or solana installed before by chance? I have dabbled in rust but not solana so that's why I want to isolate.

@FrackinFamous
Copy link

LOL same here. Been on this for 3-4 hours now and about to give up

Honestly wondering if the tut is even relevant to what we need to know to get a better understanding or just move on. Obviously it's been an issue for a long while.

@ShibtBryce
Copy link

Got it. I just needed to update solana....

@FrackinFamous
Copy link

Got it. I just needed to update solana....

Hell yea! Congrats. Hit me up if you run into any issues and I'll do the same.

@ShibtBryce
Copy link

ShibtBryce commented Jan 29, 2024 via email

@ohaddahan
Copy link

Still an issue, and conflicts with sqlx 0.7.3 which requires 0.8.6 or higher hence the workaround here doesn't help.

@i7solar
Copy link

i7solar commented Mar 26, 2024

Still an issue causing an issue for ahash.

@bell152
Copy link

bell152 commented May 22, 2024

Have these problems been solved?

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
cargo update -p [email protected] --precise ver
where ver is the latest version of solana-program supporting rustc 1.68.0-dev

My environment:
cargo-build-sbf --version
solana-cargo-build-sbf 1.17.34
platform-tools v1.37
rustc 1.68.0

cargo --version
cargo 1.78.0 (54d8815d0 2024-03-26)

rustc --version
rustc 1.78.0 (9b00956e5 2024-04-29)

rustup toolchain list
stable-aarch64-apple-darwin (default) (override)
solana

OS: Apple M2 Max

@keolamation
Copy link

um not fixed, trying to deploy a smart contract and having the EXACT same issue.

@Jeffreyon
Copy link

What tf is going on with this Anchor setup, over a year now and still nothing has been resolved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

No branches or pull requests