Skip to content

chore: silence rust-analyzer's cyclic-deps log spam - #294

Merged
samlaf merged 1 commit into
mainfrom
chore/silence-ra-cyclic-deps-log
Sep 4, 2026
Merged

chore: silence rust-analyzer's cyclic-deps log spam#294
samlaf merged 1 commit into
mainfrom
chore/silence-ra-cyclic-deps-log

Conversation

@samlaf

@samlaf samlaf commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to f6e49c5. Opening the workspace floods the rust-analyzer server log with "cyclic deps" warnings, one per dev-dependency cycle in the crate graph.

They are all dev-dependency cycles, which Cargo allows. rust-analyzer keeps one crate-graph node per package and does not separate dev-deps from normal deps, so the standard "A dev-depends on B, B depends on A" pattern always looks like a cycle to it. Nearly all of ours are upstream reth's — reth-trie-db and reth-provider dev-depend on each other, and so on. The two that touch our crates are reth-seismic-node's dev-dep on itself, copied verbatim from reth-optimism-node, and reth-seismic-primitives dev-depending on reth-seismic-test-utils for a single test module. None of it is worth restructuring; upstream reth configures nothing for these and lives with them.

So filter the log instead. RA_LOG is a tracing Targets filter, and add_dep_inner is the only tracing::warn! in project_model::workspace, so raising just that module to "error" drops these lines and keeps everything else: the module's own tracing::error! calls still pass, and every other module stays at "warn", rust-analyzer's own default.

Measured with the 1.95.0 rust-analyzer, running analysis-stats over seismic-reth/crates/seismic/test-utils: 19 "cyclic deps" lines before, 0 after, and no other WARN or ERROR output in either run.

This does not address the separate task_pool.rs SendError panic on server shutdown — that is a known upstream bug
(rust-lang/rust-analyzer#18055), unrelated to logging config.

Follow-up to f6e49c5. Opening the workspace floods the rust-analyzer
server log with "cyclic deps" warnings, one per dev-dependency cycle in
the crate graph.

They are all dev-dependency cycles, which Cargo allows. rust-analyzer
keeps one crate-graph node per package and does not separate dev-deps
from normal deps, so the standard "A dev-depends on B, B depends on A"
pattern always looks like a cycle to it. Nearly all of ours are upstream
reth's — reth-trie-db and reth-provider dev-depend on each other, and so
on. The two that touch our crates are reth-seismic-node's dev-dep on
itself, copied verbatim from reth-optimism-node, and
reth-seismic-primitives dev-depending on reth-seismic-test-utils for a
single test module. None of it is worth restructuring; upstream reth
configures nothing for these and lives with them.

So filter the log instead. RA_LOG is a tracing Targets filter, and
add_dep_inner is the only tracing::warn! in project_model::workspace, so
raising just that module to "error" drops these lines and keeps
everything else: the module's own tracing::error! calls still pass, and
every other module stays at "warn", rust-analyzer's own default.

Measured with the 1.95.0 rust-analyzer, running analysis-stats over
seismic-reth/crates/seismic/test-utils: 19 "cyclic deps" lines before,
0 after, and no other WARN or ERROR output in either run.

This does not address the separate task_pool.rs SendError panic on
server shutdown — that is a known upstream bug
(rust-lang/rust-analyzer#18055), unrelated to
logging config.
@samlaf
samlaf requested a review from cdrappi as a code owner September 4, 2026 20:36
@samlaf
samlaf merged commit d99e46c into main Sep 4, 2026
2 checks passed
@samlaf
samlaf deleted the chore/silence-ra-cyclic-deps-log branch September 4, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant