# Dune dependency computing

**URL:** <https://discuss.ocaml.org/t/dune-dependency-computing/6022>\
**Category:** Learning\
**Tags:** dune\
**Created:** [June 24, 2020, 8:06am UTC](https://discuss.ocaml.org/t/dune-dependency-computing/6022 "2020-06-24T08:06:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maiste](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/maiste/32/3919_2.png) [@maiste](https://discuss.ocaml.org/u/maiste)\
**Post date:** [June 24, 2020, 8:06am UTC](https://discuss.ocaml.org/t/dune-dependency-computing/6022/1 "2020-06-24T08:06:36Z")

</div>

Hi,  
I try to move a project from dune 1.6.3 to dune 1.7. This dune is used to build some embedded cmis files:

```auto
(rule
 (targets embedded_grading_cmis.ml)
 (deps (:compiler-cmis
        %{ocaml-config:standard_library}/compiler-libs/longident.cmi
        %{ocaml-config:standard_library}/compiler-libs/asttypes.cmi
        %{ocaml-config:standard_library}/compiler-libs/ast_helper.cmi
        %{ocaml-config:standard_library}/compiler-libs/ast_mapper.cmi
        %{ocaml-config:standard_library}/compiler-libs/parsetree.cmi
        %{ocaml-config:standard_library}/compiler-libs/location.cmi
        %{ocaml-config:standard_library}/compiler-libs/parse.cmi)
       (:generated-cmis
        ../ppx-metaquot/.ty.objs/ty.cmi
        ../ppx-metaquot/.fun_ty.objs/fun_ty.cmi
        .testing.objs/introspection_intf.cmi
        .learnocaml_report.objs/learnocaml_report.cmi
        .testing.objs/test_lib.cmi
        .testing.objs/mutation_test.cmi))
 (action (with-stdout-to %{targets}
           (run ocp-ocamlres -format ocamlres %{compiler-cmis} %{generated-cmis})))
)

(library
 (name grading)
 (wrapped false)
 (modes byte)
 (library_flags :standard -linkall)
 (libraries testing
            learnocaml_ppx_metaquot
            ocplib-ocamlres.runtime
            embedded_cmis
            ocplib_i18n
            learnocaml_report)
 (modules Embedded_grading_cmis
          Grading)
 (preprocess (per_module ((pps ppx_ocplib_i18n learnocaml_ppx_metaquot) Grading)))
)

```

With the 1.6.3 version everything works great but with the 1.7 version, I get this error and I don’t understand why:

```auto
File "src/grader/dune", line 98, characters 0-954:
 98 | (rule
 99 | (targets embedded_grading_cmis.ml)
100 | (deps (:compiler-cmis
.....115 | (action (with-stdout-to %{targets}
116 | (run ocp-ocamlres -format ocamlres %{compiler-cmis} %{generated-cmis})))
117 | )
Error: No rule found for
src/grader/.learnocaml_report.objs/learnocaml_report.cmi

```

Does everyone know if there is a way to fix this ?

---

<div class="post-metadata">

**Author:** ![nojb](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/nojb/32/519_2.png) [@nojb](https://discuss.ocaml.org/u/nojb)\
**Post date:** [June 24, 2020, 8:28am UTC](https://discuss.ocaml.org/t/dune-dependency-computing/6022/2 "2020-06-24T08:28:40Z")

</div>

It may be that the directory where `dune` places the built `.cmi`s has changed. You could try with `.<libname>.objs/byte/<modname>.cmi`, eg `.testing.objs/byte/test_lib.cmi` (that is what is used in the current version of `dune`, but not sure if that is also the case for 1.7).

Having said that, two remarks:

- The exact directory layout is an implementation detail of `dune` and may change in the future; if the library to which the `.cmi`s belong is public you can use instead `%{lib:<public-name>:<modname>.cmi}` instead, see [https://dune.readthedocs.io/en/stable/concepts.html#variables](https://dune.readthedocs.io/en/stable/concepts.html#variables)

- Any specific reason why you are not upgrading to dune 2, which has many improvements over dune 1?

Best wishes,  
Nicolás

---

<div class="post-metadata">

**Author:** ![maiste](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/maiste/32/3919_2.png) [@maiste](https://discuss.ocaml.org/u/maiste)\
**Post date:** [June 24, 2020, 8:42am UTC](https://discuss.ocaml.org/t/dune-dependency-computing/6022/3 "2020-06-24T08:42:06Z")

</div>

Thanks so much for your explanations, it works perfectly.  
About your two remarks:

- Unfortunately, it’s a local library, so I can’t use this syntax…
- The only reason why I want to move to dune 1.7 is `virtual libraries`. Otherwise, there isn’t any specific reason to not upgrading to dune 2.0 if it stays compatible with Ocaml 4.05.0. I will give it a try! Thanks!
