brson · GitHub

Thanks for the patch. I left a comment on the ticket about resuming downloads.

As written, I think this will be ineffective because the destination is a random temporary directory. To make this work I think the script would need to create a directory in ~/.rustup, and put the file there. Even still, one has to figure out what to name the file to find it later. We can't just download rustup-init and resume it later because the contents of that file change from release to release; so if we were to resume it it would be possible to splice two different binaries together (unless HTTP resume has some recovery mechanism to prevent that).

One way to fix that problem would be to first download rustup-init.sha256, parse the hash out, name the file after the hash. Another way to ameliorate the problem would be to validate the hash after the download.

Read the original on github.com ↗