Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyclic deps with test_store #4443

Closed
gusinacio opened this issue Mar 10, 2023 · 3 comments
Closed

Cyclic deps with test_store #4443

gusinacio opened this issue Mar 10, 2023 · 3 comments

Comments

@gusinacio
Copy link
Member

Do you want to request a feature or report a bug?
Bug

What is the current behavior?

Currently, rust-analyzer can't index the whole project because of some cyclic deps.

[ERROR project_model::workspace] cyclic deps: graph_core(CrateId(175)) -> graph_chain_substreams(CrateId(172)), alternative path: graph_chain_substreams(CrateId(172)) -> graph_core(CrateId(175))
[ERROR project_model::workspace] cyclic deps: test_store(CrateId(431)) -> graph(CrateId(156)), alternative path: graph(CrateId(156)) -> test_store(CrateId(431))
[ERROR project_model::workspace] cyclic deps: test_store(CrateId(431)) -> graph_chain_ethereum(CrateId(166)), alternative path: graph_chain_ethereum(CrateId(166)) -> graph(CrateId(156)) -> test_store(CrateId(431))
[ERROR project_model::workspace] cyclic deps: test_store(CrateId(431)) -> graph_graphql(CrateId(177)), alternative path: graph_graphql(CrateId(177)) -> graph(CrateId(156)) -> test_store(CrateId(431))
[ERROR project_model::workspace] cyclic deps: test_store(CrateId(431)) -> graph_mock(CrateId(181)), alternative path: graph_mock(CrateId(181)) -> graph(CrateId(156)) -> test_store(CrateId(431))
[ERROR project_model::workspace] cyclic deps: test_store(CrateId(431)) -> graph_node(CrateId(182)), alternative path: graph_node(CrateId(182)) -> graph(CrateId(156)) -> test_store(CrateId(431))
[ERROR project_model::workspace] cyclic deps: test_store(CrateId(431)) -> graph_store_postgres(CrateId(195)), alternative path: graph_store_postgres(CrateId(195)) -> graph(CrateId(156)) -> test_store(CrateId(431))

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

Using rust-analyzer analysis-stats . or using the VSCode extension in the project gives this problem.

The development mainly of tests is more difficult because there are a lot of the following error in functions from test-store:

expected &{unknown}, found &<Type>

It just affects the rust-analyzer, cargo continues to build well.

What is the expected behavior?

It should index all the files from the different project of the workspace using rust-analyzer.

This may not be a problem with graph-node but with rust-analyzer. There's this issue on their repository with other people with the same problem but graph-node has cyclics depenencies.

@neysofu
Copy link
Member

neysofu commented Mar 12, 2023

expected &{unknown}, found &

Holy... I had no idea it was caused by this. I've had "rust-analyzer.diagnostics.disabled": ["type-mismatch"] in my settings.json for the longest time to avoid this issue. Thank you for the bug report.

@lutter
Copy link
Collaborator

lutter commented Mar 13, 2023

Nice! I had no idea that that's behind all those annoying errors in tests.

@lutter
Copy link
Collaborator

lutter commented Apr 12, 2023

This has been addressed with #4510

@lutter lutter closed this as completed Apr 12, 2023
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

No branches or pull requests

3 participants