chore: silence rust-analyzer's cyclic-deps log spam - #294
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.