Skip to content

Commit 922579d

Browse files
committed
Update tokio base dependencies to tokio 1.x
1 parent d563830 commit 922579d

File tree

11 files changed

+351
-390
lines changed

11 files changed

+351
-390
lines changed

Cargo.lock

Lines changed: 322 additions & 360 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

collector/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ libc = "0.2"
1717
chrono = "0.4"
1818
lazy_static = "1"
1919
semver = "1.0"
20-
reqwest = { version = "0.10", features = ["json"] }
20+
reqwest = { version = "0.11", features = ["json"] }
2121
xz2 = "0.1.3"
2222
tar = "0.4"
23-
tokio = { version = "0.2", features = ["rt-core"] }
24-
rustc-artifacts = "0.2"
23+
tokio = { version = "1.6", features = ["rt"] }
24+
rustc-artifacts = { path = "../../rustc-artifacts"}
2525
database = { path = "../database" }
2626
intern = { path = "../intern" }
2727
futures = "0.3.5"

collector/src/main.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -546,13 +546,12 @@ fn main_result() -> anyhow::Result<i32> {
546546

547547
let benchmark_dir = PathBuf::from("collector/benchmarks");
548548

549-
let mut builder = tokio::runtime::Builder::new();
549+
let mut builder = tokio::runtime::Builder::new_multi_thread();
550550
// We want to minimize noise from the runtime
551551
builder
552-
.core_threads(1)
553-
.max_threads(1)
554-
.enable_io()
555-
.basic_scheduler();
552+
.worker_threads(1)
553+
.max_blocking_threads(1)
554+
.enable_io();
556555
let mut rt = builder.build().expect("built runtime");
557556

558557
let default_db = "results.db";
@@ -810,7 +809,7 @@ fn main_result() -> anyhow::Result<i32> {
810809
}
811810

812811
pub fn get_commit_or_fake_it(sha: &str) -> anyhow::Result<Commit> {
813-
let mut rt = tokio::runtime::Runtime::new().unwrap();
812+
let rt = tokio::runtime::Runtime::new().unwrap();
814813
Ok(rt
815814
.block_on(rustc_artifacts::master_commits())
816815
.map_err(|e| anyhow::anyhow!("{:?}", e))

database/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ edition = "2018"
1010
hashbrown = { version = "0.11", features = ["serde"] }
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
13-
rusqlite = { version = "0.23", features = ["bundled"] }
14-
tokio-postgres = { version = "0.5.4", features = ["with-serde_json-1", "with-chrono-0_4"] }
13+
rusqlite = { version = "0.25", features = ["bundled"] }
14+
tokio-postgres = { version = "0.7", features = ["with-serde_json-1", "with-chrono-0_4", "runtime"] }
1515
anyhow = "1"
1616
async-trait = "0.1"
17-
tokio = { version = "0.2.21", features = ["sync", "macros"] }
17+
tokio = { version = "1.6", features = ["sync", "macros"] }
1818
snap = "1"
1919
intern = { path = "../intern" }
2020
chrono = "0.4"
21-
reqwest = { version = "0.10.5", features = ["blocking"] }
22-
postgres-native-tls = "0.3"
21+
reqwest = { version = "0.11", features = ["blocking"] }
22+
postgres-native-tls = "0.5"
2323
native-tls = "0.2"
2424
lazy_static = "1"
2525
env_logger = "0.8"

database/src/bin/export-to-sqlite.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ async fn copy<R: Table>(
310310
R::trailer()
311311
)
312312
.as_str(),
313-
vec![],
313+
Vec::<u32>::new(),
314314
)
315315
.await
316316
.unwrap();

database/src/bin/ingest-json.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,14 @@ impl Ingesting for Sqlite<'_> {
289289
let mut exact = series.chunks_exact(9);
290290
for series in exact.by_ref() {
291291
cached
292-
.execute(series.iter().flat_map(|v| {
292+
.execute(rusqlite::params_from_iter(series.iter().flat_map(|v| {
293293
vec![
294294
ToSqlOutput::Borrowed(ValueRef::Text(v.krate.as_bytes())),
295295
ToSqlOutput::Borrowed(ValueRef::Text(v.profile.as_bytes())),
296296
ToSqlOutput::Borrowed(ValueRef::Text(v.cache.as_bytes())),
297297
ToSqlOutput::Borrowed(ValueRef::Text(v.statistic.as_bytes())),
298298
]
299-
}))
299+
})))
300300
.unwrap();
301301
}
302302
for v in exact.remainder() {
@@ -357,14 +357,14 @@ impl Ingesting for Sqlite<'_> {
357357
let mut exact = series.chunks_exact(21);
358358
for series in exact.by_ref() {
359359
cached
360-
.execute(series.iter().flat_map(|v| {
360+
.execute(rusqlite::params_from_iter(series.iter().flat_map(|v| {
361361
vec![
362362
ToSqlOutput::Borrowed(ValueRef::Text(v.krate.as_bytes())),
363363
ToSqlOutput::Borrowed(ValueRef::Text(v.profile.as_bytes())),
364364
ToSqlOutput::Borrowed(ValueRef::Text(v.cache.as_bytes())),
365365
ToSqlOutput::Borrowed(ValueRef::Text(v.query.as_bytes())),
366366
]
367-
}))
367+
})))
368368
.unwrap();
369369
}
370370
for v in exact.remainder() {

database/src/pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ where
210210
}
211211

212212
async fn get(&self) -> ManagedConnection<T> {
213-
let permit = self.permits.clone().acquire_owned().await;
213+
let permit = self.permits.clone().acquire_owned().await.unwrap();
214214
let conn = {
215215
let mut slots = self.connections.lock().unwrap_or_else(|e| e.into_inner());
216216
slots.pop()

site/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ env_logger = "0.8"
99
anyhow = "1"
1010
thiserror = "1"
1111
futures = "0.3"
12-
tokio = { version = "0.2", features = ["macros", "time"] }
12+
tokio = { version = "1.6", features = ["macros", "time"] }
1313
log = "0.4"
1414
serde = { version = "1", features = ["rc"] }
1515
serde_derive = "1"
1616
serde_json = "1"
17-
hyper = "0.13"
17+
hyper = { version = "0.14", features = ["server", "stream"] }
1818
headers = "0.3"
1919
http = "0.2"
2020
home = "0.5"
@@ -25,19 +25,19 @@ ring = "0.16.10"
2525
hex = "0.4.2"
2626
regex = "1"
2727
lazy_static = "1"
28-
reqwest = { version = "0.10", features = ["json", "blocking"] }
28+
reqwest = { version = "0.11", features = ["json", "blocking"] }
2929
toml = "0.5"
3030
rust_team_data = { git = "https://github.com/rust-lang/team" }
3131
parking_lot = "0.11"
3232
snap = "1"
33-
rustc-artifacts = "0.2.2"
33+
rustc-artifacts = { path = "../../rustc-artifacts"}
3434
itertools = "0.10"
3535
hashbrown = { version = "0.11", features = ["serde"] }
3636
arc-swap = "1.3"
37-
rusqlite = { version = "0.23", features = ["bundled"] }
37+
rusqlite = { version = "0.25", features = ["bundled"] }
3838
async-trait = "0.1"
3939
database = { path = "../database" }
40-
bytes = "0.5.6"
40+
bytes = "1.0"
4141
url = "2"
4242
analyzeme = { git = "https://github.com/rust-lang/measureme" }
4343
tar = "0.4"

site/src/github.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ r? @ghost",
188188
let rollup_merge_sha = rollup_merge_sha.to_owned();
189189
tokio::task::spawn(async move {
190190
// Give github time to create the merge commit reference
191-
tokio::time::delay_for(Duration::from_secs(30)).await;
191+
tokio::time::sleep(Duration::from_secs(30)).await;
192192
// This provides the master SHA so that we can check that we only queue
193193
// an appropriate try build. If there's ever a race condition, i.e.,
194194
// master was pushed while this command was running, the user will have to

site/src/self_profile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
44
use crate::load::InputData;
55
use anyhow::Context;
6-
use bytes::buf::BufExt;
6+
use bytes::Buf;
77
use hyper::StatusCode;
88
use std::collections::HashMap;
99
use std::fmt;

site/src/server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// option. This file may not be copied, modified, or distributed
88
// except according to those terms.
99

10-
use bytes::buf::BufExt;
10+
use bytes::Buf;
1111
use parking_lot::Mutex;
1212
use std::cell::RefCell;
1313
use std::collections::HashMap;
@@ -1773,7 +1773,7 @@ async fn run_server(data: Arc<RwLock<Option<Arc<InputData>>>>, addr: SocketAddr)
17731773
}))
17741774
}
17751775
});
1776-
let server = hyper::Server::bind(&addr).serve(svc);
1776+
let server = hyper::server::Server::bind(&addr).serve(svc);
17771777
if let Err(e) = server.await {
17781778
eprintln!("server error: {:?}", e);
17791779
}

0 commit comments

Comments
 (0)