diff --git a/pkgs/build-support/rust/fetch-cargo-tarball/cargo-vendor-normalise.py b/pkgs/build-support/rust/fetch-cargo-tarball/cargo-vendor-normalise.py index 2d7a18957184..90933b089c92 100755 --- a/pkgs/build-support/rust/fetch-cargo-tarball/cargo-vendor-normalise.py +++ b/pkgs/build-support/rust/fetch-cargo-tarball/cargo-vendor-normalise.py @@ -13,7 +13,9 @@ def quote(s: str) -> str: def main() -> None: data = toml.load(sys.stdin) - assert list(data.keys()) == ["source"] + # There is no dependency to vendor in this project. + if not list(data.keys()) == ["source"]: + return # this value is non deterministic data["source"]["vendored-sources"]["directory"] = "@vendor@" diff --git a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix index e2ee870f22a3..6d6219078bac 100644 --- a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix +++ b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix @@ -71,6 +71,8 @@ in stdenv.mkDerivation ({ cargo vendor $name --respect-source-config | cargo-vendor-normalise > $CARGO_CONFIG + # Create an empty vendor directory when there is no dependency to vendor + mkdir -p $name # Add the Cargo.lock to allow hash invalidation cp Cargo.lock.orig $name/Cargo.lock