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

Incorrect minimum Rust version (1.69.0) #336

Closed
mooori opened this issue Nov 3, 2023 · 3 comments
Closed

Incorrect minimum Rust version (1.69.0) #336

mooori opened this issue Nov 3, 2023 · 3 comments

Comments

@mooori
Copy link

mooori commented Nov 3, 2023

According to docs, [email protected] should support Rust v1.69.0 and up. However, tests using near-workspaces with Rust 1.69.0 can not compile. We face that issue with near-plugins and the same issue popped up here.

Background

near-workspaces depends on anstyle v1.0.4, which requires at least Rust 1.70.0.

cargo tree -i anstyle
anstyle v1.0.4
├── anstream v0.6.4
│   └── clap_builder v4.4.7
│       └── clap v4.4.7
│           └── near-o11y v0.17.0
│               └── near-chain-configs v0.17.0
│                   ├── near-jsonrpc-client v0.6.0
│                   │   └── near-workspaces v0.9.0
│                   │       [dev-dependencies]
│                   │       └── near-plugins-derive v0.v0.1.0 (proc-macro)
│                   │           └── near-plugins v0.1.0

Why didn’t this break near-workspaces CI?

Perhaps there is no action checking that the stated minimum Rust version is actually supported? At least this test run appears to be using the latest Rust version (1.73.0).

One way to reproduce this

  • Checkout this commit of the rust-version branch of near-plugin’s.
  • Apply below diff to use Rust 1.69.0 and then run cargo test --workspace
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,7 +12,7 @@ version = "0.15.0"
 version = "0.1.0"
 edition = "2021"
 authors = ["Aurora Labs <[email protected]>"]
-rust-version = "1.70.0"
+rust-version = "1.69.0"
 description = "Ergonomic plugin system to extend NEAR contracts."
 license = "CC0-1.0"
 readme = "README.md"
diff --git a/rust-toolchain b/rust-toolchain
index 1cba0df..6649306 100644
--- a/rust-toolchain
+++ b/rust-toolchain
@@ -1,4 +1,4 @@
 [toolchain]
-channel = "1.70.0"
+channel = "1.69.0"
 components = ["clippy", "rustfmt"]
 targets = [ "wasm32-unknown-unknown" ]
@frol
Copy link
Collaborator

frol commented Nov 3, 2023

@mooori We cannot stop leaf dependencies from upgrading and breaking MSRV, and there is no requirement to bump MSRV for near-workspaces-rs when you can still use older leaf dependency that supports MSRV:

See how near-sdk-rs pins the dependencies to check that near-sdk-rs itself is still 1.69.0 compatible:
https://github.com/near/near-sdk-rs/blob/ee5cf867741d6d0d4db15857609b9e9268cc9b32/.github/workflows/test.yml#L26-L32

cargo update -p anstyle --precise 1.0.2
cargo update -p anstyle-parse --precise 0.2.1

I wish cargo could be smarter about MSRV requirements and pull compatible versions of the dependencies.

@frol frol closed this as completed Nov 3, 2023
@mooori
Copy link
Author

mooori commented Nov 8, 2023

Since [email protected] depends on two versions of clap, unfortunately this becomes a bit more tricky. So, for instance, downgrading clap requires -p [email protected] instead of just -p clap. I assume this requires updating the command once a new version of clap is released, as described in this comment.

@frol
Copy link
Collaborator

frol commented Nov 8, 2023

@mooori I hope to cut new versions of near-* crates from nearcore until the end of this month, and then near-o11y will be removed from the dependency tree and this issue will be gone.

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

No branches or pull requests

2 participants