rust-lang / rustwide

Execute your code on the Rust ecosystem.
Apache License 2.0
180 stars 44 forks source link

Switch from reqwest to attohttpc #49

Closed jyn514 closed 3 years ago

jyn514 commented 3 years ago

This cuts down compile times by 10 seconds out of a 35 second build.

Before: https://jyn514.github.io/assets/cargo-timing-reqwest.html After: https://jyn514.github.io/assets/cargo-timing-attohttpc.html

jyn514 commented 3 years ago

This also gets rid of several duplicate dependencies:

pin-project v0.4.27
└── tracing-futures v0.2.4 (*)

pin-project v1.0.1
├── futures-util v0.3.8
│   ├── h2 v0.2.7 (*)
│   ├── hyper v0.13.9 (*)
│   ├── reqwest v0.10.8 (*)
│   └── rustwide v0.11.0 (/home/joshua/rustwide)
└── hyper v0.13.9 (*)

pin-project-internal v0.4.27 (proc-macro)
└── pin-project v0.4.27 (*)

pin-project-internal v1.0.1 (proc-macro)
└── pin-project v1.0.1 (*)
pietroalbini commented 3 years ago

Hmm, Linux builds are hanging due to this.

jyn514 commented 3 years ago

Strangely, this hangs when calling docker, not when making HTTP requests:

[INFO  rustwide::cmd::sandbox] pulling image rustops/crates-build-env from Docker Hub
[INFO  rustwide::cmd] running `Command { std: "docker" "pull" "rustops/crates-build-env", kill_on_drop: false }`
test run_binary_with_same_name_as_file ... test run_binary_with_same_name_as_file has been running for over 60 seconds

On master, it works fine:

[INFO  rustwide::cmd::sandbox] pulling image rustops/crates-build-env from Docker Hub
[INFO  rustwide::cmd] running `Command { std: "docker" "pull" "rustops/crates-build-env", kill_on_drop: false }`
[INFO  rustwide::cmd] [stdout] Using default tag: latest
[INFO  rustwide::cmd] [stdout] latest: Pulling from rustops/crates-build-env
[INFO  rustwide::cmd] [stdout] 6a5697faee43: Pulling fs layer

Not sure why my changed would have affected running docker.

jyn514 commented 3 years ago

... if this is because a tokio feature is no longer pulled in by reqwest, I'm going to be really mad.