Replace custom download crate with reqwest
reqwest is mature enough that I don't feel the need to keep maintaining an abstraction layer, and would rather be using pure Rust instead of curl.
Make sure that it continues obeying the relevant environment variables for setting up proxies.
One thing to mention, I notice proxy support is still a work in progress (https://github.com/seanmonstar/reqwest/issues/30).
Ah ok, we probably need to wait then, though somebody could go ahead and overhaul the code such that it supports only curl and reqwest, so reqwest can be switched on later.
It seems that proxy support has been added a while back, see: https://github.com/seanmonstar/reqwest/pull/152
However, I can't find a way to measure the progress of files that are being downloaded, and I don't think reqwest supports reporting the download progress yet.
I believe a feature like this is desired, as the current download implementation in rustup also reports the download progress.
Edit: apparently it is possible using the implemented Read trait over the reqwest Response object, in a similar fashion as this hyper implementation. Although it seems quite hacky.
We've been using reqwest by default for a while now, but there're still some issues on odd minority platforms which we haven't solved which means curl based downloads are currently still needed. I'll keep an eye on this.
Looks like a perfect final step for #3790! I've added this to the task list.
I think we can close this now? We're using reqwest by default, which IMO is good enough to cover the original ask here.
@djc Not yet; it's about the download crate. The end goal, of course, is that download crate becomes a part of our single crate. I've done that linking for you.