diff --git a/Cargo.lock b/Cargo.lock index 395460347..dfa7b0019 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -289,13 +289,11 @@ dependencies = [ [[package]] name = "color-eyre" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aaa5f071a62a9c06ebab653ec2e2ba76cb936548a83e7af7f0c5dac525067ff" +version = "0.5.0" +source = "git+https://github.com/yaahc/color-eyre.git?branch=hooked#f882a88a7037aa621a42c3719d06a2286aa0f8de" dependencies = [ "ansi_term", "backtrace", - "color-backtrace", "color-spantrace", "eyre", "indenter", @@ -445,11 +443,11 @@ dependencies = [ [[package]] name = "eyre" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e412cbea04ea7af520b2f4d4ac1677ce546027a7237d8a40b494e34e1e0e31" +version = "0.6.0" +source = "git+https://github.com/yaahc/eyre.git?branch=hooked#48e8006298651b3640ba7214f1b3b129b3babe67" dependencies = [ "indenter", + "once_cell", ] [[package]] @@ -2343,7 +2341,6 @@ name = "zebra-consensus" version = "0.1.0" dependencies = [ "color-eyre", - "eyre", "futures-util", "spandoc", "tokio", @@ -2397,7 +2394,6 @@ name = "zebra-state" version = "0.1.0" dependencies = [ "color-eyre", - "eyre", "futures", "hex", "lazy_static", @@ -2430,7 +2426,6 @@ dependencies = [ "abscissa_core", "chrono", "color-eyre", - "eyre", "futures", "gumdrop", "hyper", diff --git a/tower-batch/Cargo.toml b/tower-batch/Cargo.toml index 96110514e..13e6dfaf4 100644 --- a/tower-batch/Cargo.toml +++ b/tower-batch/Cargo.toml @@ -21,4 +21,4 @@ tokio = { version = "0.2", features = ["full"]} tracing-error = "0.1.2" tracing-subscriber = "0.2.6" tracing = "0.1.15" -color-eyre = "0.3.4" +color-eyre = { git = "https://github.com/yaahc/color-eyre.git", branch = "hooked", features = ["capture-spantrace"] } diff --git a/tower-batch/tests/ed25519.rs b/tower-batch/tests/ed25519.rs index bfef93079..23d3136ac 100644 --- a/tower-batch/tests/ed25519.rs +++ b/tower-batch/tests/ed25519.rs @@ -7,6 +7,7 @@ use std::{ time::Duration, }; +use color_eyre::eyre::Result; use ed25519_zebra::*; use futures::stream::{FuturesUnordered, StreamExt}; use rand::thread_rng; @@ -130,7 +131,7 @@ where } #[tokio::test] -async fn batch_flushes_on_max_items() -> color_eyre::Result<()> { +async fn batch_flushes_on_max_items() -> Result<()> { use tokio::time::timeout; install_tracing(); @@ -141,7 +142,7 @@ async fn batch_flushes_on_max_items() -> color_eyre::Result<()> { } #[tokio::test] -async fn batch_flushes_on_max_latency() -> color_eyre::Result<()> { +async fn batch_flushes_on_max_latency() -> Result<()> { use tokio::time::timeout; install_tracing(); diff --git a/zebra-consensus/Cargo.toml b/zebra-consensus/Cargo.toml index 157787685..1247ff74b 100644 --- a/zebra-consensus/Cargo.toml +++ b/zebra-consensus/Cargo.toml @@ -15,10 +15,9 @@ tower = "0.3.1" [dev-dependencies] zebra-test-vectors = { path = "../zebra-test-vectors/" } -color-eyre = "0.3.4" -eyre = "0.4.2" spandoc = { git = "https://github.com/yaahc/spandoc.git" } tokio = { version = "0.2.21", features = ["full"] } tracing = "0.1.15" tracing-error = "0.1.2" tracing-subscriber = "0.2.6" +color-eyre = { git = "https://github.com/yaahc/color-eyre.git", branch = "hooked", features = ["capture-spantrace"] } diff --git a/zebra-consensus/src/verify.rs b/zebra-consensus/src/verify.rs index b347b9d35..119ec9aea 100644 --- a/zebra-consensus/src/verify.rs +++ b/zebra-consensus/src/verify.rs @@ -105,8 +105,8 @@ where #[cfg(test)] mod tests { use super::*; - use color_eyre::Report; - use eyre::{bail, ensure, eyre}; + use color_eyre::eyre::Report; + use color_eyre::eyre::{bail, ensure, eyre}; use tower::{util::ServiceExt, Service}; use zebra_chain::serialization::ZcashDeserialize; diff --git a/zebra-state/Cargo.toml b/zebra-state/Cargo.toml index a30441d77..52314ca13 100644 --- a/zebra-state/Cargo.toml +++ b/zebra-state/Cargo.toml @@ -10,7 +10,6 @@ edition = "2018" [dependencies] zebra-chain = { path = "../zebra-chain" } tower = "0.3.1" -eyre = "0.4.2" futures = "0.3.5" lazy_static = "1.4.0" hex = "0.4.2" @@ -18,8 +17,6 @@ sled = "0.32.0" serde = { version = "1", features = ["serde_derive"] } [dev-dependencies] -color-eyre = "0.3.4" -eyre = "0.4.2" tokio = { version = "0.2.21", features = ["full"] } zebra-test-vectors = { path = "../zebra-test-vectors/" } spandoc = { git = "https://github.com/yaahc/spandoc.git" } @@ -28,3 +25,4 @@ tracing-futures = "0.2.4" tracing-error = "0.1.2" tracing-subscriber = "0.2.6" tempdir = "0.3.7" +color-eyre = { git = "https://github.com/yaahc/color-eyre.git", branch = "hooked", features = ["capture-spantrace"] } diff --git a/zebra-state/src/lib.rs b/zebra-state/src/lib.rs index 2d3414462..f83ad73f5 100644 --- a/zebra-state/src/lib.rs +++ b/zebra-state/src/lib.rs @@ -84,8 +84,8 @@ pub enum Response { #[cfg(test)] mod tests { use super::*; - use color_eyre::Report; - use eyre::{bail, ensure, eyre}; + use color_eyre::eyre::Report; + use color_eyre::eyre::{bail, ensure, eyre}; use std::sync::Once; use tower::Service; use tracing_error::ErrorLayer; diff --git a/zebrad/Cargo.toml b/zebrad/Cargo.toml index 9b33ee33a..70392371b 100644 --- a/zebrad/Cargo.toml +++ b/zebrad/Cargo.toml @@ -30,11 +30,10 @@ metrics = "0.12" zebra-chain = { path = "../zebra-chain" } zebra-network = { path = "../zebra-network" } -eyre = "0.4.3" -color-eyre = "0.3.4" zebra-state = { path = "../zebra-state" } tracing-subscriber = { version = "0.2.6", features = ["tracing-log"] } tracing-error = "0.1.2" +color-eyre = { git = "https://github.com/yaahc/color-eyre.git", branch = "hooked", features = ["capture-spantrace"] } [dev-dependencies] abscissa_core = { version = "0.5", features = ["testing"] } diff --git a/zebrad/src/application.rs b/zebrad/src/application.rs index f1ddf1a06..2a2c09368 100644 --- a/zebrad/src/application.rs +++ b/zebrad/src/application.rs @@ -85,6 +85,7 @@ impl Application for ZebradApp { ) -> Result>>, FrameworkError> { let terminal = Terminal::new(self.term_colors(command)); let tracing = self.tracing_component(command); + color_eyre::install().unwrap(); Ok(vec![Box::new(terminal), Box::new(tracing)]) } diff --git a/zebrad/src/commands/connect.rs b/zebrad/src/commands/connect.rs index 6469abd89..29f3b2941 100644 --- a/zebrad/src/commands/connect.rs +++ b/zebrad/src/commands/connect.rs @@ -2,8 +2,7 @@ use crate::{components::tokio::TokioComponent, prelude::*}; use abscissa_core::{Command, Options, Runnable}; -use color_eyre::Report; -use eyre::{eyre, WrapErr}; +use color_eyre::eyre::{eyre, Report, WrapErr}; use futures::{ prelude::*, stream::{FuturesUnordered, StreamExt}, diff --git a/zebrad/src/commands/seed.rs b/zebrad/src/commands/seed.rs index c99bf3f7d..e7c7227bf 100644 --- a/zebrad/src/commands/seed.rs +++ b/zebrad/src/commands/seed.rs @@ -14,8 +14,7 @@ use tower::{buffer::Buffer, Service, ServiceExt}; use zebra_network::{AddressBook, BoxedStdError, Request, Response}; use crate::prelude::*; -use color_eyre::Report; -use eyre::eyre; +use color_eyre::eyre::{eyre, Report}; /// Whether our `SeedService` is poll_ready or not. #[derive(Debug)] diff --git a/zebrad/src/commands/start.rs b/zebrad/src/commands/start.rs index 193cad539..4c218fe09 100644 --- a/zebrad/src/commands/start.rs +++ b/zebrad/src/commands/start.rs @@ -21,8 +21,8 @@ use crate::config::ZebradConfig; use crate::{components::tokio::TokioComponent, prelude::*}; use abscissa_core::{config, Command, FrameworkError, Options, Runnable}; -use color_eyre::Report; -use eyre::{eyre, WrapErr}; +use color_eyre::eyre::Report; +use color_eyre::eyre::{eyre, WrapErr}; use futures::{ prelude::*, stream::{FuturesUnordered, StreamExt}, diff --git a/zebrad/src/config.rs b/zebrad/src/config.rs index a6ff0d4d4..26ea37741 100644 --- a/zebrad/src/config.rs +++ b/zebrad/src/config.rs @@ -59,8 +59,10 @@ impl Default for MetricsSection { #[cfg(test)] mod test { + use color_eyre::eyre::Result; + #[test] - fn test_toml_ser() -> color_eyre::Result<()> { + fn test_toml_ser() -> Result<()> { let default_config = super::ZebradConfig::default(); println!("Default config: {:?}", default_config);