# How do you debug your dune/dune-packages/\*.opam?

**URL:** <https://discuss.ocaml.org/t/how-do-you-debug-your-dune-dune-packages-opam/17773>\
**Category:** Ecosystem\
**Tags:** opam, build, dune\
**Created:** [February 3, 2026, 2:02pm UTC](https://discuss.ocaml.org/t/how-do-you-debug-your-dune-dune-packages-opam/17773 "2026-02-03T14:02:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yoric](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yoric/32/6071_2.png) [@Yoric](https://discuss.ocaml.org/u/Yoric)\
**Post date:** [February 3, 2026, 2:02pm UTC](https://discuss.ocaml.org/t/how-do-you-debug-your-dune-dune-packages-opam/17773/1 "2026-02-03T14:02:01Z")

</div>

In the project I’m working on, since my latest rebase, I get a

```auto
Missing dependency:
    - deps-of-foo → bin_prot < v0.12.0
    no matching version

```

which is fairly weird, because I’ve explicitly specified `bin_prot = 0.16.0`.

I will eventually find out what’s wrong, by bissecting stuff, but I’m sure that there is a better way to do this.

Is there a way to ask opam or dune to tell me which path led to requiring `bin_prot < v0.12.0`?

---

<div class="post-metadata">

**Author:** ![WardBrian](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/wardbrian/32/3971_2.png) [@WardBrian](https://discuss.ocaml.org/u/WardBrian)\
**Post date:** [February 3, 2026, 2:41pm UTC](https://discuss.ocaml.org/t/how-do-you-debug-your-dune-dune-packages-opam/17773/2 "2026-02-03T14:41:05Z")

</div>

`opam tree` might do what you’re asking? I’m not sure how it works when there are conflicts

---

<div class="post-metadata">

**Author:** ![kit-ty-kate](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/kit-ty-kate/32/5953_2.png) [@kit-ty-kate](https://discuss.ocaml.org/u/kit-ty-kate)\
**Post date:** [February 3, 2026, 2:59pm UTC](https://discuss.ocaml.org/t/how-do-you-debug-your-dune-dune-packages-opam/17773/3 "2026-02-03T14:59:29Z")

</div>

> [@Yoric](#):
>
> which is fairly weird, because I’ve explicitly specified `bin_prot = 0.16.0`.

without seeing the source, my guess would be that you forgot the initial `v` prefix, common for janestreet packages due to a version scheme rename some years ago.  
It should be `bin_prot = v0.16.0` (the initial v is not optional)

---

<div class="post-metadata">

**Author:** ![Yoric](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yoric/32/6071_2.png) [@Yoric](https://discuss.ocaml.org/u/Yoric)\
**Post date:** [February 3, 2026, 3:02pm UTC](https://discuss.ocaml.org/t/how-do-you-debug-your-dune-dune-packages-opam/17773/4 "2026-02-03T15:02:30Z")

</div>

Sadly, according to `opam tree`, _nothing_ expects `< 0.12.0`.

I’m sure that the constraint comes from somewhere, though 🙂

---

<div class="post-metadata">

**Author:** ![Yoric](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yoric/32/6071_2.png) [@Yoric](https://discuss.ocaml.org/u/Yoric)\
**Post date:** [February 3, 2026, 3:03pm UTC](https://discuss.ocaml.org/t/how-do-you-debug-your-dune-dune-packages-opam/17773/5 "2026-02-03T15:03:13Z")

</div>

Thanks, this seems to be the issue at hand!

But I’d be interested in a more general answer on how to debug such issues in the future.

---

<div class="post-metadata">

**Author:** ![kit-ty-kate](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/kit-ty-kate/32/5953_2.png) [@kit-ty-kate](https://discuss.ocaml.org/u/kit-ty-kate)\
**Post date:** [February 3, 2026, 3:41pm UTC](https://discuss.ocaml.org/t/how-do-you-debug-your-dune-dune-packages-opam/17773/6 "2026-02-03T15:41:13Z")

</div>

> [@Yoric](#):
>
> But I’d be interested in a more general answer on how to debug such issues in the future.

that’s a good question but i don’t think there are any satisfying answers at the moment sadly.  
The code in charge of explaining why the dependency solver can’t find a solution is quite complex and was already improved quite a bit in [ocaml/opam#6106](https://github.com/ocaml/opam/pull/6106) as part of opam 2.3.0, but it is still pretty confusing in most cases due to the way it currently works.

In your case for example, the reason you get v0.12.0 instead of 0.16.0 is because version numbers are reconstructed using existing packages instead of taken directly from the package definition (for internal historical reasons), so since 0.16.0 doesn’t exist the code will take the closest existing version which is v0.12.0 (since 0.16.0 \< v0.12.0 \< v0.16.0).

I’m hoping to be able to fix that in the future but i haven’t had the time to work on it since (contributions are always welcome if anyone is interested though)

---

<div class="post-metadata">

**Author:** ![Yoric](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yoric/32/6071_2.png) [@Yoric](https://discuss.ocaml.org/u/Yoric)\
**Post date:** [February 3, 2026, 5:01pm UTC](https://discuss.ocaml.org/t/how-do-you-debug-your-dune-dune-packages-opam/17773/7 "2026-02-03T17:01:19Z")

</div>

> [@kit-ty-kate](#):
>
> I’m hoping to be able to fix that in the future but i haven’t had the time to work on it since (contributions are always welcome if anyone is interested though)

Happy to contribute.

In this specific case, a warning would have been useful, for instance. Would that be an acceptable PR?

---

<div class="post-metadata">

**Author:** ![kit-ty-kate](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/kit-ty-kate/32/5953_2.png) [@kit-ty-kate](https://discuss.ocaml.org/u/kit-ty-kate)\
**Post date:** [February 6, 2026, 10:33pm UTC](https://discuss.ocaml.org/t/how-do-you-debug-your-dune-dune-packages-opam/17773/8 "2026-02-06T22:33:17Z")

</div>

> [@Yoric](#):
>
> In this specific case, a warning would have been useful, for instance. Would that be an acceptable PR?

I’m not exactly sure what you have in mind, but sure go for it, we can discuss of the specifics in the PR
