ocaml / ocaml/dune

Cycles reported by dune are cryptic

Open
#2,818 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

build enhancement
Dominant language
OCaml
Stars
1.9k
Forks
500
Avg merge
15h 21m
Merged PRs (30d)
277

Description

Dune reports some module cycles in a way that has no relationship with what the code the user wrote. I suspect this is caused by the fact that we over-approximate the dependency graph since we started including the transitive closure of the cmi's.

I'm not exactly sure how to fix this issue, but we should start by adding some test cases reproducing the issue.

cc @emillon and @diml

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported module-cycle cases with test cases, as requested in the issue. Investigate how Dune constructs the dependency graph, particularly the inclusion of transitive closure of CMIs, and consider the cycle output complete when it reflects the modules and relationships written by the user.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.