Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace custom download crate with reqwest #993

Open
Tracked by #3790
brson opened this issue Mar 17, 2017 · 5 comments
Open
Tracked by #3790

Replace custom download crate with reqwest #993

brson opened this issue Mar 17, 2017 · 5 comments
Milestone

Comments

@brson
Copy link
Contributor

brson commented Mar 17, 2017

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.

@jelford
Copy link
Contributor

jelford commented Mar 17, 2017

One thing to mention, I notice proxy support is still a work in progress (seanmonstar/reqwest#30).

@brson
Copy link
Contributor Author

brson commented Mar 17, 2017

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.

jelford added a commit to jelford/rustup.rs that referenced this issue Mar 20, 2017
* Adds support only for the Curl backend, which is the default anyway.

* In order to distinguish between a file that has been fully downloaded
(but not used yet) and should therefore be hash-checked vs. those that
require more data, store partials with a .partial extension.

* Adds a simple http-server to rustup-mock, to allow the download module
to be properly tested. It's not clear how to easily emulate a server
that stops half-way without that. The tests for the overall
download-resumption functionality should be fairly re-usable if we migrate
to another download solution in the future (e.g. in rust-lang#993)

* Don't bother with resumption for meta-data files, since they're likely
to go out of date anyway.
nodakai pushed a commit to nodakai/rustup.rs that referenced this issue Apr 23, 2017
* Adds support only for the Curl backend, which is the default anyway.

* In order to distinguish between a file that has been fully downloaded
(but not used yet) and should therefore be hash-checked vs. those that
require more data, store partials with a .partial extension.

* Adds a simple http-server to rustup-mock, to allow the download module
to be properly tested. It's not clear how to easily emulate a server
that stops half-way without that. The tests for the overall
download-resumption functionality should be fairly re-usable if we migrate
to another download solution in the future (e.g. in rust-lang#993)

* Don't bother with resumption for meta-data files, since they're likely
to go out of date anyway.
@timvisee
Copy link

timvisee commented Mar 19, 2018

It seems that proxy support has been added a while back, see: seanmonstar/reqwest#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.

@kinnison
Copy link
Contributor

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.

@rami3l
Copy link
Member

rami3l commented Jun 9, 2024

Looks like a perfect final step for #3790! I've added this to the task list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants