rust-lang / rustlings

:crab: Small exercises to get you used to reading and writing Rust code!
https://rustlings.cool
MIT License
52.82k stars 10.03k forks source link

Nix environment fails to build, package mismatch. #1972

Closed iamcult closed 4 months ago

iamcult commented 4 months ago

When running nix develop, the environment fails to build due to a version mismatch between rustc and clap_derive.

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/gl897450g3blvm4wm16l71xlh76h3syp-source
source root is source
Executing cargoSetupPostUnpackHook
Finished cargoSetupPostUnpackHook
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
Executing cargoSetupPostPatchHook
Validating consistency between /build/source/Cargo.lock and /build/cargo-vendor-dir/Cargo.lock
Finished cargoSetupPostPatchHook
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
@nix { "action": "setPhase", "phase": "buildPhase" }
building
Executing cargoBuildHook
++ env CC_x86_64-unknown-linux-gnu=/nix/store/v1wa8ysdv5lc516fbh25m8ysigwv1k20-gcc-wrapper-12.3.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/v1wa8ysdv5lc516fbh25m8ysigwv1k20-gcc-wrapp>
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.72.0
Either upgrade to rustc 1.74 or newer, or use
cargo update -p clap_derive@4.5.4 --precise ver
where `ver` is the latest version of `clap_derive` supporting rustc 1.72.0

this issue is fixed by updating the inputs in flake.lock.