| 3 Dec 2025 |
neobrain | Interesting point about caching of dependencies. I would've assumed the mapping of Cargo.lock would create a separate nix store entry for each dependency (and hence trivially cache things), but I'm probably underestimating the problem space :) | 22:35:27 |
dish [Fox/It/She] | sorry, thats what I meant. I see the main value prob of the {naersk,crane,fenix,etc} solutions as being that they allow using betas/nightlys if wanted | 22:35:42 |
dish [Fox/It/She] | I'm not a rust dev but that is one of the main things I've noticed | 22:35:52 |
neobrain | Ah, gotcha | 22:36:04 |
dish [Fox/It/She] | maybe I'm wrong in that way but from my usage in the past thats been my reason to use them | 22:36:10 |
dish [Fox/It/She] | * maybe I'm wrong in that way but from my usage in the past thats been my reason to use them over buildRustPackage | 22:36:13 |
dish [Fox/It/She] | since I just use cargo during active dev | 22:36:42 |
rosssmyth | For an example of the caching, you can see what I did with Wild. Basically the assumption is "the Cargo.lock and flake.lock files do not change very often (compared to the rest of the souce)"
So there's a dedicated job that refreshes the cache when the lockfiles change Then another job for running with the cached dependencies And a cron job to periodically update the flake lockfile
| 22:37:03 |
rosssmyth | You can use nightly and beta with buildRustPackage just as easily as the other options, so I wouldn't really say that's an advantage. It's even shown in the reference how to | 22:38:21 |
rosssmyth | You just can't in Nixpkgs | 22:38:34 |
neobrain | rosssmyth: How do you handle day-to-day development? Do you enter a nix shell or do you always nix run/build? If it's purely the former, I'm guessing the main benefit of the caching is for CI? | 22:39:26 |
neobrain | * rosssmyth: How do you handle day-to-day development? Do you enter a nix shell (and then use Cargo manually) or do you always nix run/build? If it's purely the former, I'm guessing the main benefit of the caching is for CI? | 22:39:45 |