Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,15 +357,14 @@ lldb target/debugging/forest

## Cargo Features

- **`default`** - `jemalloc`, `tokio-console`, `tracing-loki`, `tracing-chrome`
- **`default`** - `jemalloc`, `tracing-loki`
Comment thread
LesnyRumcajs marked this conversation as resolved.
Outdated
- **`test`** - Default feature set for unit tests
- **`slim`** - Minimal feature set (uses rustalloc)
- **`jemalloc`** - Use jemalloc allocator (production default)
- **`rustalloc`** - Use Rust standard allocator
- **`system-alloc`** - Use system allocator (for memory profiling)
- **`tokio-console`** - Enable tokio-console integration
- **`tracing-loki`** - Send telemetry to Loki
- **`tracing-chrome`** - Chrome tracing support
- **`no-f3-sidecar`** - Disable F3 sidecar build
- **`cargo-test`** - Group of tests that is recommended to run with `cargo test` instead of `nextest`
- **`doctest-private`** - Enable doctests for private items
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@

### Breaking

- [#6680](https://github.com/ChainSafe/forest/pull/6680) Made the `tokio-console` feature optional and disabled by default. Users relying on this feature must now explicitly compile Forest with `--features tokio-console` to enable it.
Comment thread
LesnyRumcajs marked this conversation as resolved.
Outdated

### Added

### Changed

### Removed

- [#6681](https://github.com/ChainSafe/forest/pull/6681) Removed `tracing-chrome` feature and all related code as it was deemed unused. If you didn't set `CHROME_TRACE_FILE` manually before, you shouldn't be affected by this change. If you were using this feature, reach out.

### Fixed

## Forest v0.32.3 "Unimpressive Serenity"
Expand Down
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 6 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ zstd = "0.13"
console-subscriber = { version = "0.5", features = ["parking_lot"], optional = true }
sqlx = { version = "0.8", default-features = false, features = ["sqlite", "runtime-tokio", "macros"], optional = true }
tikv-jemallocator = { version = "0.6", optional = true }
tracing-chrome = { version = "0.7", optional = true }
tracing-loki = { version = "0.2", default-features = false, features = ["compat-0-2-1", "rustls"], optional = true }

[target.'cfg(unix)'.dependencies]
Expand Down Expand Up @@ -320,13 +319,13 @@ lto = "fat"

# These should be refactored (probably removed) in #2984
[features]
default = ["jemalloc", "tokio-console", "tracing-loki", "tracing-chrome", "sqlite"]
test = [] # default feature set for unit tests
default = ["jemalloc", "tracing-loki", "sqlite"]
test = [] # default feature set for unit tests
slim = ["rustalloc"]
cargo-test = [] # group of tests that is recommended to run with `cargo test` instead of `nextest`
doctest-private = [] # see lib.rs::doctest_private
benchmark-private = ["dep:criterion"] # see lib.rs::benchmark_private
interop-tests-private = [] # see lib.rs::interop_tests_private
cargo-test = [] # group of tests that is recommended to run with `cargo test` instead of `nextest`
doctest-private = [] # see lib.rs::doctest_private
benchmark-private = ["dep:criterion"] # see lib.rs::benchmark_private
interop-tests-private = [] # see lib.rs::interop_tests_private
sqlite = ["dep:sqlx"]

# Allocator. Use at most one of these.
Expand All @@ -336,7 +335,6 @@ system-alloc = [] # Use the platform allocator (for memory pr

tokio-console = ["dep:console-subscriber"]
tracing-loki = ["dep:tracing-loki"]
tracing-chrome = ["dep:tracing-chrome"]

no-f3-sidecar = []

Expand Down
2 changes: 1 addition & 1 deletion src/cli/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ where

let client = rpc::Client::default_or_from_env(token.as_deref())?;

let (_bg_tasks, _guards) = logger::setup_logger(&crate::cli_shared::cli::CliOpts::default());
let _bg_tasks = logger::setup_logger(&crate::cli_shared::cli::CliOpts::default());

cmd.run(client).await
}
33 changes: 2 additions & 31 deletions src/cli_shared/logger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,9 @@ use crate::utils::misc::LoggingColor;

type BackgroundTask = Pin<Box<dyn Future<Output = ()> + Send>>;

#[derive(Default)]
pub struct Guards {
#[cfg(feature = "tracing-chrome")]
tracing_chrome: Option<tracing_chrome::FlushGuard>,
}

#[allow(unused_mut)]
pub fn setup_logger(opts: &CliOpts) -> (Vec<BackgroundTask>, Guards) {
pub fn setup_logger(opts: &CliOpts) -> Vec<BackgroundTask> {
let mut background_tasks: Vec<BackgroundTask> = vec![];
let mut guards = Guards::default();
let mut layers: Vec<Box<dyn tracing_subscriber::layer::Layer<Registry> + Send + Sync>> =
// console logger
vec![Box::new(
Expand Down Expand Up @@ -88,30 +81,8 @@ pub fn setup_logger(opts: &CliOpts) -> (Vec<BackgroundTask>, Guards) {
}
}

// Go to <https://ui.perfetto.dev> to browse trace files.
// You may want to call ChromeLayerBuilder::trace_style as appropriate
if let Some(_chrome_trace_file) = std::env::var_os("CHROME_TRACE_FILE") {
#[cfg(not(feature = "tracing-chrome"))]
tracing::warn!(
"`tracing-chrome` is unavailable, forest binaries need to be recompiled with `tracing-chrome` feature"
);

#[cfg(feature = "tracing-chrome")]
{
let (layer, guard) = match _chrome_trace_file.is_empty() {
true => tracing_chrome::ChromeLayerBuilder::new().build(),
false => tracing_chrome::ChromeLayerBuilder::new()
.file(_chrome_trace_file)
.build(),
};

guards.tracing_chrome = Some(guard);
layers.push(Box::new(layer));
}
}

tracing_subscriber::registry().with(layers).init();
(background_tasks, guards)
background_tasks
}

// Log warnings to stderr
Expand Down
2 changes: 1 addition & 1 deletion src/daemon/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ where
// Run forest as a daemon if no other subcommands are used. Otherwise, run the
// subcommand.

let (background_tasks, _guards) = logger::setup_logger(&opts);
let background_tasks = logger::setup_logger(&opts);

if let Some(path) = &path {
match path {
Expand Down
Loading