Skip to content

nix should use curl -C #89

fare opened this Issue Feb 14, 2013 · 1 comment

2 participants

fare commented Feb 14, 2013

On bad connections, loading a single big file in one go is a non-starter. That's why curl has option -C for continue/resume, and other tools have similar options. Nix should use it. This assumes that Nix should somehow be able to determine the total size at the beginning of the download query, and/or cache it together with a digest of the file, and that it should detect issues that lead to incomplete download, so as not to delete the partial file in those cases (as opposed to cases of file corruption).

This all suggests that, like apt, nix should have a download protocol that knows about partial files and resume, and use that instead of a trivial curl.

(This issue might be for nix rather than nixos.)

Official Nix/Nixpkgs/NixOS member

It's actually for both Nix and Nixpkgs, but not NixOS :-)

Nix's substituters (i.e. for downloading binaries) can probably be made to use -C fairly easily.

Nixpkgs' fetchurl is trickier because it may run under a build user uid. So having a shared cache for partially downloaded files is hard. OTOH, fetchurl does use curl's --retry flag, so maybe in combination with -C, curl will do resumes automatically?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.