Open jian-lin opened 3 months ago
buildGoModule
solves a similar problem
That is an upstream feature of go and nothing nixpkgs implements.
Note that unless cargo can resolve dependencies differently across OSs (some package managers can switch dependencies based on build os, i don't know of any that can do it based on target os, but I assume there might be, and cargo might be one of them), and the dependencies only contain source code and not outputs / intermediates, then the hashes should always be the same, and any discrepancies are likely to be due to file system case sensitivity issues, bugs in os specific code paths in cargo itself, stuff like that.
Unfortunately I don't know enough about cargo and its ecosystem to say for sure, but wanted to raise it since similar issues pop up in the maintenance of darwin support of other packages in nixpkgs, like the bazel related ones.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/cargo-lock-considered-harmful/49047/3
Two related upstream issues are added.
Describe the bug
The
cargoHash
might be different on linux and darwin systems. I know that kanata, atuin and trunk-ng have this problem. There are more affected packages.This problem seems to be caused by the case sensitivity of file systems.
Additional context
buildGoModule
solves a similar problem usingproxyVendor
.Notify maintainers
@NixOS/rust
Add a :+1: reaction to issues you find important.