codecrafters-io / build-your-own-redis

Definition for the redis challenge.
https://app.codecrafters.io/courses/redis/overview
MIT License
101 stars 29 forks source link

Rustc 1.70 clashing with latest clap (4.5.4) #206

Closed lgiordani closed 3 weeks ago

lgiordani commented 1 month ago

Hi! While solving the Redis challenge with Rust I got this error after I pushed to the server. I'm sure I can fix it for now, as I just need to use a previous version of clap, but it might be useful for you to know that some packages now don't support 1.70 any more.

remote: [build] >   Downloaded clap v4.5.4
remote: [build] > error: package `clap_derive v4.5.4` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.70.0
remote: [build] > Either upgrade to rustc 1.74 or newer, or use
remote: [build] > cargo update -p clap_derive@4.5.4 --precise ver
remote: [build] > where `ver` is the latest version of `clap_derive` supporting rustc 1.70.0
remote: [build] Error: process "/bin/sh -c cargo build --release --target-dir=/tmp/codecrafters-redis-target" did not complete successfully: exit code: 101.
remote: [build] >   Downloaded clap_lex v0.7.0
remote: [build] >   Downloaded bytes v1.3.0
remote: [build] >   Downloaded cfg-if v1.0.0
remote: [build] >   Downloaded autocfg v1.1.0
remote: [build] >   Downloaded anstyle-parse v0.2.4
remote: [build] >   Downloaded clap v4.5.4
remote: [build] > error: package `clap_derive v4.5.4` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.70.0
remote: [build] > Either upgrade to rustc 1.74 or newer, or use
remote: [build] > cargo update -p clap_derive@4.5.4 --precise ver
remote: [build] > where `ver` is the latest version of `clap_derive` supporting rustc 1.70.0
remote: [build] Build failed. Check the logs above for the reason.
remote: [build] If you think this is a CodeCrafters error, please contact us at hello@codecrafters.io.

Should you need to replicate, my current Cargo.toml is

[package]
name = "redis-starter-rust"
version = "0.1.0"
authors = ["Codecrafters <hello@codecrafters.io>"]
edition = "2021"

[dependencies]
anyhow = "1.0.59"                                   # error handling
bytes = "1.3.0"                                     # helps manage buffers
clap = { version = "4.5.4", features = ["derive"] }
thiserror = "1.0.32"                                # error handling
tokio = { version = "1.23.0", features = ["full"] } # async networking

Thanks!

linear[bot] commented 1 month ago

CC-1264 Rustc 1.70 clashing with latest clap (4.5.4)

lgiordani commented 1 month ago

I experimented with different toolchains, however apparently there is a long standing issue in Cargo, and it's not easy to install a previous version of the package clap. This means that with the current setup it is not possible to use the package, I believe.

Any suggestion? Thanks!

rohitpaulk commented 3 weeks ago

Hey @lgiordani! We do support 1.77 now, if you create a new repository the newer version should get picked up.

lgiordani commented 3 weeks ago

Thanks @rohitpaulk!