New version of tokio is released
reqwest vesrion of tokio is 0.2 Cargo.toml
Better upgrade, to avoid downloading two versions of tokio in projects
This actually seems to prevent upstream binaries from upgrading to tokio:0.3.0.
I tried upgrading my cli app bitbucket_server_cli, here is the result trying to run with incompatible tokio-versions
thread 'main' panicked at 'there is no timer running, must be called from the context of Tokio runtime', /Users/jensim/.cargo/registry/src/github.com-1acb6219da9ec827/tokio-0.2.22/src/time/driver/handle.rs:25:14
stack backtrace:
0: 0x10edea394 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd4b962ed89f71a03
1: 0x10ee0de10 - core::fmt::write::h94ae1e793baa7a00
2: 0x10ede448b - std::io::Write::write_fmt::h5c716758fdc3057f
3: 0x10edebf45 - std::panicking::default_hook::{{closure}}::hc6119c7d16548caf
4: 0x10edebc87 - std::panicking::default_hook::heae8b62897b351dc
5: 0x10edec4e5 - std::panicking::rust_panic_with_hook::hc36596b4257bea99
6: 0x10edec07b - std::panicking::begin_panic_handler::{{closure}}::h49e5ddc3f21ca2fb
7: 0x10edea808 - std::sys_common::backtrace::__rust_end_short_backtrace::h9bd32c9ad3fad18f
8: 0x10edec03a - _rust_begin_unwind
9: 0x10ee2619f - core::panicking::panic_fmt::hcdc9362d34d55302
10: 0x10ee2602a - core::option::expect_failed::h2cf6417a1cce758c
11: 0x10eda9147 - tokio::time::delay::delay_for::ha5c963747a903eaf
12: 0x10eceb48d - reqwest::async_impl::client::Client::execute_request::hf7a8c0de5eae6488
13: 0x10ed284e2 - reqwest::async_impl::request::RequestBuilder::send::hcf6b3611e4279255
14: 0x10ea49476 - bitbucket_server_cli::bitbucket::worker::BitbucketWorker::fetch_all_user_repos::{{closure}}::hddcb554493bccb0e
15: 0x10ea5ad7d - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hf40a34645155b35e
16: 0x10ea32b81 - std::thread::local::LocalKey<T>::with::hc20d5bef6701544d
17: 0x10ea389f7 - tokio::runtime::enter::Enter::block_on::h9eb328f39405ec67
18: 0x10ea3cea5 - tokio::runtime::thread_pool::ThreadPool::block_on::h4174e4a4d5e0c544
19: 0x10ea69bed - tokio::runtime::Runtime::block_on::h2bc0cb0537fac7ec
20: 0x10ea354de - bitbucket_server_cli::main::h07f0683523971a5d
21: 0x10ea6397a - std::sys_common::backtrace::__rust_begin_short_backtrace::h12ac5d6b20230f57
22: 0x10ea6399c - std::rt::lang_start::{{closure}}::h771a80e1366e93a1
23: 0x10edec880 - std::rt::lang_start_internal::hd0c760d47f593c0a
24: 0x10ea355b9 - _main
Looking at reqwest dependency tree we are also blocked by the dependency chain
โ reqwest git:(master) cargo tree -i tokio
tokio v0.2.22
โโโ h2 v0.2.6
โ โโโ hyper v0.13.8
โ โโโ hyper-tls v0.4.3
โ โ โโโ reqwest v0.10.8 (/Users/jenbri/vcs/github/reqwest)
โ โโโ reqwest v0.10.8 (/Users/jenbri/vcs/github/reqwest)
โ [dev-dependencies]
โ โโโ reqwest v0.10.8 (/Users/jenbri/vcs/github/reqwest)
โโโ hyper v0.13.8 (*)
โโโ hyper-tls v0.4.3 (*)
โโโ reqwest v0.10.8 (/Users/jenbri/vcs/github/reqwest)
โโโ tokio-tls v0.3.1
โ โโโ hyper-tls v0.4.3 (*)
โ โโโ reqwest v0.10.8 (/Users/jenbri/vcs/github/reqwest)
โโโ tokio-util v0.3.1
โโโ h2 v0.2.6 (*)
[dev-dependencies]
โโโ reqwest v0.10.8 (/Users/jenbri/vcs/github/reqwest)
https://github.com/meilisearch/meilisearch-rust/issues/57
https://github.com/Creatiwity/siren/pull/178
https://github.com/ThouCheese/cloud-storage-rs/issues/41
https://github.com/teloxide/teloxide/issues/292
https://github.com/teloxide/teloxide-core/issues/17
https://github.com/khuey/bb8/issues/82
https://github.com/graphql-rust/juniper/pull/794
https://github.com/hatoo/oha/issues/113
https://github.com/andrey-yantsen/plex-api.rs/pull/91
https://github.com/Azure/azure-sdk-for-rust/pull/59
https://github.com/Azure/azure-sdk-for-rust/issues/60
https://github.com/tg-rs/tgbot/issues/3
https://github.com/seanmonstar/warp/issues/725
https://github.com/tag1consulting/goose/pull/205
https://github.com/rhysd/git-brws/issues/29
https://github.com/wayofthepie/ctlogs-cli/pull/69
https://github.com/tag1consulting/goose/pull/213
https://github.com/labooner/doclink-checker/issues/2
https://github.com/olback/gnome-twitch-2/issues/9
https://github.com/JonaC22/portfolio-cli/pull/3
https://github.com/enarx/enarx-keepmgr/pull/10
https://github.com/robotty/recent-messages2/pull/68
https://github.com/dmolokanov/appinsights-rs/pull/131
https://github.com/1tgr/rust-websocket-lite/pull/118
https://github.com/IronCoreLabs/ironoxide/pull/194
https://github.com/IronCoreLabs/ironoxide-cli/pull/38
https://github.com/testcontainers/testcontainers-rs/pull/221
https://github.com/eldesh/dockworker/pull/99
https://github.com/camallo/dkregistry-rs/pull/188
N.B. this also means that trying to use reqwest from a tokio 0.3 runtime will give you this rather cryptic panic: https://github.com/tokio-rs/tokio/issues/1837
@seanmonstar Is there anything I can do to help get this done faster? Could we do a point release?
This is waiting on hyper 0.14, which can be tracked here: https://github.com/hyperium/hyper/milestone/6
Progress keeps being made there :)
I got reqwest to compile by cloning patched versions of reqwest, hyper, and hyper-rustls and modifying their Config.toml files:
git checkout #a3da4e094ede0f3c3ac45a2215742315b61dacca@tokio-0-3Cargo.toml and update dependency statements:http-body = { git = "https://github.com/hyperium/http-body", rev = "5e434739" }hyper = { path = "../hyper", default-features = false, features = ["tcp", "http1", "http2", "client"] }hyper-rustls = { path = "../hyper-rustls", default-features = false, optional = true }hyper-tls = { path = "../hyper-tls", optional = true }git checkout #121c33132c0950aaa422848cdc43f6691ddf5785Cargo.toml and update dependency statements:http-body = { git = "https://github.com/hyperium/http-body", rev = "5e434739" }git checkout #e7f38abb797ef08039542b72ef6689a38102f7dfCargo.toml and update dependency statements:hyper = { path = "../hyper", default-features = false }rustls-tls)git checkout #07dc2306696b83d1a16476ea04c8c0755e6bff9d@bump-tokioCargo.toml and update dependency statements:hyper = { path = "../hyper", default-features = false, features = ["tcp", "client", "http1"] }My project's integration test now builds and runs. The Cargo.toml has:
[dependencies]
rustls = "0.18"
tokio = { version = "0.3", features = ["macros", "stream", "sync", "time"] }
tokio-rustls = "0.20"
[dev-dependencies]
reqwest = { path = "../deps/reqwest", features = ["rustls-tls"] }
tokio = { version = "0.3", features = ["fs", "macros", "net", "rt-multi-thread", "signal"] }
tokio-test = "0.3"
Thank you, all of you who are updating reqwest and its dependencies! :)
EDIT: Add rustls-tls feature config.
Most helpful comment
I got reqwest to compile by cloning patched versions of
reqwest,hyper, andhyper-rustlsand modifying theirConfig.tomlfiles:git checkout #a3da4e094ede0f3c3ac45a2215742315b61dacca@tokio-0-3Cargo.tomland update dependency statements:http-body = { git = "https://github.com/hyperium/http-body", rev = "5e434739" }hyper = { path = "../hyper", default-features = false, features = ["tcp", "http1", "http2", "client"] }hyper-rustls = { path = "../hyper-rustls", default-features = false, optional = true }hyper-tls = { path = "../hyper-tls", optional = true }git checkout #121c33132c0950aaa422848cdc43f6691ddf5785Cargo.tomland update dependency statements:http-body = { git = "https://github.com/hyperium/http-body", rev = "5e434739" }git checkout #e7f38abb797ef08039542b72ef6689a38102f7dfCargo.tomland update dependency statements:hyper = { path = "../hyper", default-features = false }rustls-tls)git checkout #07dc2306696b83d1a16476ea04c8c0755e6bff9d@bump-tokioCargo.tomland update dependency statements:hyper = { path = "../hyper", default-features = false, features = ["tcp", "client", "http1"] }My project's integration test now builds and runs. The
Cargo.tomlhas:Thank you, all of you who are updating reqwest and its dependencies! :)
EDIT: Add
rustls-tlsfeature config.