Stream: beginners

Topic: cyclic dependencies in roc repo


view this post on Zulip Eli Dowling (Dec 01 2023 at 09:22):

When trying to edit the rust code in the main roc repo i get a bunch of errors about cyclic dependencies from rust analyzer and i can't get completion working in any projects effected:

2023-12-01T19:16:16.156 helix_lsp::transport [ERROR] rust-analyzer err <- "[ERROR project_model::workspace] cyclic deps: test_solve_helpers(CrateId(361)) -> roc_load(CrateId(268)), alternative path: roc_load(CrateId(268)) -> roc_load_internal(CrateId(271)) -> roc_late_solve(CrateId(266)) -> roc_solve(CrateId(289)) -> test_solve_helpers(CrateId(361))\n"
2023-12-01T19:16:16.157 helix_lsp::transport [ERROR] rust-analyzer err <- "[ERROR project_model::workspace] cyclic deps: test_solve_helpers(CrateId(361)) -> roc_solve(CrateId(289)), alternative path: roc_solve(CrateId(289)) -> test_solve_helpers(CrateId(361))\n"

I'm wondering if there is some setting I should change or some such?
This happens in both helix and vscode.
I checked and the cycle does indeed exist

view this post on Zulip Eli Dowling (Dec 01 2023 at 09:27):

https://github.com/rust-lang/rust-analyzer/issues/14167 This issue basically says it's a terrible idea and you should just try replace any code with cycles

view this post on Zulip Richard Feldman (Dec 01 2023 at 11:42):

yeah I'd love to fix these. For some reason the rust compiler never mentions these (I haven't even figured out a way to get it to tell me about them at the command line, only rust analyzer seems to know about them) and so we accumulated a bunch of them over the years before sometime a few months ago I started seeing rust analyzer errors about them

view this post on Zulip Brendan Hansknecht (Dec 01 2023 at 15:25):

I'm surprised that's not a clippy check.


Last updated: Jul 06 2025 at 12:14 UTC