Merge pull request #130462 from rski/importCargoLock
rustPlatform.importCargoLock: add an assert for old Cargo.locks
This commit is contained in:
commit
b2fac1cfe0
@ -63,11 +63,19 @@ let
|
|||||||
|
|
||||||
# We can't use the existing fetchCrate function, since it uses a
|
# We can't use the existing fetchCrate function, since it uses a
|
||||||
# recursive hash of the unpacked crate.
|
# recursive hash of the unpacked crate.
|
||||||
fetchCrate = pkg: fetchurl {
|
fetchCrate = pkg:
|
||||||
name = "crate-${pkg.name}-${pkg.version}.tar.gz";
|
assert lib.assertMsg (pkg ? checksum) ''
|
||||||
url = "https://crates.io/api/v1/crates/${pkg.name}/${pkg.version}/download";
|
Package ${pkg.name} does not have a checksum.
|
||||||
sha256 = pkg.checksum;
|
Please note that the Cargo.lock format where checksums used to be listed
|
||||||
};
|
under [metadata] is not supported.
|
||||||
|
If that is the case, running `cargo update` with a recent toolchain will
|
||||||
|
automatically update the format along with the crate's depenendencies.
|
||||||
|
'';
|
||||||
|
fetchurl {
|
||||||
|
name = "crate-${pkg.name}-${pkg.version}.tar.gz";
|
||||||
|
url = "https://crates.io/api/v1/crates/${pkg.name}/${pkg.version}/download";
|
||||||
|
sha256 = pkg.checksum;
|
||||||
|
};
|
||||||
|
|
||||||
# Fetch and unpack a crate.
|
# Fetch and unpack a crate.
|
||||||
mkCrate = pkg:
|
mkCrate = pkg:
|
||||||
|
Loading…
Reference in New Issue
Block a user