@@ -63,11 +63,19 @@ let
6363
6464 # We can't use the existing fetchCrate function, since it uses a
6565 # recursive hash of the unpacked crate.
66− fetchCrate = pkg: fetchurl {
67− name = "crate-${pkg.name}-${pkg.version}.tar.gz";
68− url = "https://crates.io/api/v1/crates/${pkg.name}/${pkg.version}/download";
69− sha256 = pkg.checksum;
70− };
66+ fetchCrate = pkg:
67+ assert lib.assertMsg (pkg ? checksum) ''
68+ Package ${pkg.name} does not have a checksum.
69+ Please note that the Cargo.lock format where checksums used to be listed
70+ under [metadata] is not supported.
71+ If that is the case, running `cargo update` with a recent toolchain will
72+ automatically update the format along with the crate's depenendencies.
73+ '';
74+ fetchurl {
75+ name = "crate-${pkg.name}-${pkg.version}.tar.gz";
76+ url = "https://crates.io/api/v1/crates/${pkg.name}/${pkg.version}/download";
77+ sha256 = pkg.checksum;
78+ };
7179
7280 # Fetch and unpack a crate.
7381 mkCrate = pkg: