From e0ab5ee4f86ca4e38629bc950c2a6af490da3744 Mon Sep 17 00:00:00 2001 From: Govlzkoy Date: Tue, 8 Jun 2021 14:17:16 +0800 Subject: [PATCH] update dependence version for gag to latest support windows (#17801) * update dependence version for gag to leatest support windows * fix compile on windows * add Cargo.lock --- Cargo.lock | 17 ++++++++++++++--- banking-bench/src/main.rs | 6 +++--- local-cluster/Cargo.toml | 2 +- validator/src/lib.rs | 2 +- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11c20e3d33..0d0a9a20f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1347,6 +1347,17 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" +[[package]] +name = "filedescriptor" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a71e83755e51aa52b9034f1986173783789e8e7d79c3c774adbbb63fb554f2cb" +dependencies = [ + "libc", + "thiserror", + "winapi 0.3.8", +] + [[package]] name = "filetime" version = "0.2.10" @@ -1540,11 +1551,11 @@ dependencies = [ [[package]] name = "gag" -version = "0.1.10" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc0b9f53275dc5fada808f1d2f82e3688a6c14d735633d1590b7be8eb2307b5" +checksum = "a713bee13966e9fbffdf7193af71d54a6b35a0bb34997cd6c9519ebeb5005972" dependencies = [ - "libc", + "filedescriptor", "tempfile", ] diff --git a/banking-bench/src/main.rs b/banking-bench/src/main.rs index 4e094f0bcf..9226150503 100644 --- a/banking-bench/src/main.rs +++ b/banking-bench/src/main.rs @@ -74,7 +74,7 @@ fn make_accounts_txs( .into_par_iter() .map(|_| { let mut new = dummy.clone(); - let sig: Vec = (0..64).map(|_| thread_rng().gen()).collect(); + let sig: Vec = (0..64).map(|_| thread_rng().gen::()).collect(); if !same_payer { new.message.account_keys[0] = solana_sdk::pubkey::new_rand(); } @@ -185,7 +185,7 @@ fn main() { genesis_config.hash(), ); // Ignore any pesky duplicate signature errors in the case we are using single-payer - let sig: Vec = (0..64).map(|_| thread_rng().gen()).collect(); + let sig: Vec = (0..64).map(|_| thread_rng().gen::()).collect(); fund.signatures = vec![Signature::new(&sig[0..64])]; let x = bank.process_transaction(&fund); x.unwrap(); @@ -351,7 +351,7 @@ fn main() { if bank.slot() > 0 && bank.slot() % 16 == 0 { for tx in transactions.iter_mut() { tx.message.recent_blockhash = bank.last_blockhash(); - let sig: Vec = (0..64).map(|_| thread_rng().gen()).collect(); + let sig: Vec = (0..64).map(|_| thread_rng().gen::()).collect(); tx.signatures[0] = Signature::new(&sig[0..64]); } verified = to_packets_chunked(&transactions.clone(), packets_per_chunk); diff --git a/local-cluster/Cargo.toml b/local-cluster/Cargo.toml index 0a341a2de0..75bf073da6 100644 --- a/local-cluster/Cargo.toml +++ b/local-cluster/Cargo.toml @@ -12,7 +12,7 @@ documentation = "https://docs.rs/solana-local-cluster" [dependencies] crossbeam-channel = "0.5" itertools = "0.9.0" -gag = "0.1.10" +gag = "1.0.0" fs_extra = "1.2.0" log = "0.4.11" rand = "0.7.0" diff --git a/validator/src/lib.rs b/validator/src/lib.rs index bafe98aeb8..6d4c35e7a3 100644 --- a/validator/src/lib.rs +++ b/validator/src/lib.rs @@ -61,7 +61,7 @@ pub fn redirect_stderr_to_file(logfile: Option) -> Option #[cfg(not(unix))] { println!("logging to a file is not supported on this platform"); - () + None } } };