2023-07-07 03:47:12 +03:00
|
|
|
## `found invalid metadata files for crate` errors
|
|
|
|
|
|
|
|
This error can occur when mixing components from two different Rust toolchains,
|
|
|
|
for example, using `clippy` with artifacts produced from a different cargo
|
|
|
|
version. Check the configuration for specifying the exact Rust toolchain to be
|
|
|
|
used in the build:
|
|
|
|
|
|
|
|
```nix
|
|
|
|
let
|
|
|
|
rustToolchain = ...;
|
|
|
|
in
|
|
|
|
# Incorrect usage, missing `clippy` override!
|
2024-02-08 06:38:28 +03:00
|
|
|
#(crane.mkLib pkgs).overrideScope (final: prev: {
|
2023-07-07 03:47:12 +03:00
|
|
|
# rustc = rustToolchain;
|
|
|
|
# cargo = rustToolchain;
|
|
|
|
# rustfmt = rustToolchain;
|
|
|
|
#});
|
|
|
|
|
|
|
|
# Correct usage (`overrideToolchain` handles the details for us)
|
|
|
|
(crane.mkLib pkgs).overrideToolchain rustToolchain
|
|
|
|
```
|