Skip to content

Commit

Permalink
build: migrate tokio console control to build.rs
Browse files Browse the repository at this point in the history
Instead of relying on dirty-ing a checked in file (.cargo/config.toml),
switch to a feature flag based flow to enable the tokio debug console.
This avoids accidental thrashing in the checked in file. It also allows
a discoverable path from the justfile for new developers.
  • Loading branch information
nyonson committed Jan 15, 2025
1 parent 807b980 commit 337fb9a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .cargo/config.toml

This file was deleted.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ database = ["rusqlite"]
dns = []
tor = ["arti-client", "tor-rtcompat"]
filter-control = []
tokio-console = []

[dev-dependencies]
corepc-node = { version = "0.5.0", default-features = false, features = [
Expand Down
4 changes: 4 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fn main() {
#[cfg(feature = "tokio-console")]
println!("cargo:rustc-cfg=tokio_unstable");
}
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ default:
build:
cargo build

# Run with the tokio console enabled for verbose debugging.
run-with-console:
cargo run --features tokio-console

check:
cargo fmt
cargo clippy --all-targets
Expand Down

0 comments on commit 337fb9a

Please sign in to comment.