3

Out of curiosity, I'm running $ rust-analyzer analysis-stats . in my substrate repo root directory.

I'm getting reports about ~30 cyclic dependencies, similar to

[ERROR project_model::workspace] cyclic deps: frame_election_provider_support(CrateId(199)) -> frame_election_provider_solution_type(CrateId(198)), alternative path: frame_election_provider_solution_type(CrateId(198)) -> frame_election_provider_support(CrateId(199))

I'm wondering if this is a problem or not? Should it be fixed or should I configure rust-analyzer to ignore it somehow?

I'm running this version: rust-analyzer 1.64.0-nightly (897a7ec 2022-07-17)

1
  • I think it may be related to this issue related to build.rs (there is a dup issue calling out cyclic deps). This was just "fixed" upstream in RA, so it should land in a release 🔜 and make it's way into the VSCode extension 🤞
    – Dan Shields
    yesterday

1 Answer 1

3

Cyclic dependencies are not allowed by Rust in general.

I looked into the specific error that is being brought up here.

Package frame-election-provider-support has a dependency on frame-election-provider-solution-type.

But package frame-election-provider-solution-type only has a dev-dependency to frame-election-provider-support.

In this case, the cyclic dependency is right, and something that is explicitly allowed by the rust testing framework.

So in this case, no, nothing needs to be fixed afaik.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.