solana icon indicating copy to clipboard operation
solana copied to clipboard

Outdated Rust version causes MSRV compile error

Open acheroncrypto opened this issue 2 years ago • 18 comments

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. https://github.com/solana-labs/solana/issues/31960#issuecomment-1668682153 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: https://github.com/solana-labs/rust/pull/85, https://github.com/solana-labs/solana/issues/31528, https://github.com/solana-labs/solana/issues/32361

acheroncrypto avatar Oct 03 '23 13:10 acheroncrypto

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

mvines avatar Oct 03 '23 20:10 mvines

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.

dmakarov avatar Oct 03 '23 20:10 dmakarov

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.

beeman avatar Jan 06 '24 08:01 beeman

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

dmakarov avatar Jan 06 '24 13:01 dmakarov

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 https://github.com/solana-labs/solana/issues/31960#issuecomment-1674740803,

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?

acheroncrypto avatar Jan 07 '24 03:01 acheroncrypto

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.

FrackinFamous avatar Jan 27 '24 14:01 FrackinFamous

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

ShibtBryce avatar Jan 27 '24 16:01 ShibtBryce

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 avatar Jan 27 '24 18:01 FrackinFamous

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.

FrackinFamous avatar Jan 27 '24 18:01 FrackinFamous

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

ShibtBryce avatar Jan 29 '24 16:01 ShibtBryce

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.

FrackinFamous avatar Jan 29 '24 21:01 FrackinFamous

Will do, thanks! I am just getting into this after being a python guy haha.


From: FrackinFamous @.> Sent: Monday, January 29, 2024 3:20 PM To: solana-labs/solana @.> Cc: ShibtBryce @.>; Comment @.> Subject: Re: [solana-labs/solana] Outdated Rust version causes MSRV compile error (Issue #33504)

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.

— Reply to this email directly, view it on GitHubhttps://github.com/solana-labs/solana/issues/33504#issuecomment-1915592159, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BFCIJGU5NC3TKQXIKZOMBG3YRAHDJAVCNFSM6AAAAAA5RA5BPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJVGU4TEMJVHE. You are receiving this because you commented.Message ID: @.***>

ShibtBryce avatar Jan 29 '24 21:01 ShibtBryce

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

ohaddahan avatar Feb 02 '24 16:02 ohaddahan

Still an issue causing an issue for ahash.

i7solar avatar Mar 26 '24 17:03 i7solar

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

bell152 avatar May 22 '24 09:05 bell152

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

keolamation avatar May 27 '24 19:05 keolamation

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

Jeffreyon avatar Jun 29 '24 13:06 Jeffreyon