Skip to content
This repository has been archived by the owner on Aug 27, 2018. It is now read-only.

nix should use curl -C #89

Open
fare opened this issue Feb 14, 2013 · 1 comment
Open

nix should use curl -C #89

fare opened this issue Feb 14, 2013 · 1 comment

Comments

@fare
Copy link

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.)

@edolstra
Copy link
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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants