You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rustPlatform.importCargoLock fails with git dependencies of the same package and version #183344
0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: rustGeneral-purpose programming language emphasizing performance, type safety, and concurrency.
rustPlatform.importCargoLock, which is used by rustPlatform.buildRustPackage when cargoLock.lockFile is set, requires explicit hashes for all git dependencies in outputHashes.<package>, because their integrity can’t be verified otherwise. They are keyed by the package name and the version, which works fine for published crates, but can fail for git dependencies, where it is possible to have two packages with the same version but a different source URL (and therefore different contents and hashes).
Steps To Reproduce
Try to import the cargo lock file for any rust project that depends on different git revisions of one package that share the same (Cargo.toml metadata) version.
In case of the latter, the build fails with the following message, even though there is a hash specified for libc-0.2.126:
error: No hash was found while vendoring the git dependency libc-0.2.126. You can add
a hash through the `outputHashes` argument of `importCargoLock`:
outputHashes = {
"libc-0.2.126" = "<hash>";
};
If you use `buildRustPackage`, you can add this attribute to the `cargoLock`
attribute set.
Expected behavior
One should be able to specify the output hash for each git version of the package that is used separately.
I get the same error even though my Cargo.lock contains the offending package (a git dep) only once. Is that the same issue or should I file a new one?
0.kind: bugSomething is broken2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: rustGeneral-purpose programming language emphasizing performance, type safety, and concurrency.
Activity
magnetophon commentedon Aug 3, 2022
I just ran into the same issue.
liferooter commentedon Apr 14, 2024
Still actual issue though, just got it with Zed editor.
risicle commentedon Apr 14, 2024
Same here, with
qdrant.nixos-discourse commentedon Dec 18, 2024
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/cannot-build-package-of-rust-application-ln-failed-to-create-symbolic-link-permission-denied/57587/2
keks commentedon Mar 31, 2025
I get the same error even though my Cargo.lock contains the offending package (a git dep) only once. Is that the same issue or should I file a new one?
try specifying git deps to make nix build work
try specifying git deps to make nix build work