This test demonstrates a dependency being pulled via an mli only module: $ cat >dune-project < (lang dune 3.7) > EOF $ lib=foo $ cat >dune < (library > (name $lib) > (wrapped false) > (modules_without_implementation uast)) > EOF $ cat >identifier.ml < let create () = () > EOF $ cat >identifier.mli < val create : unit -> unit > EOF $ cat >uast.mli < module Identifier = Identifier > EOF $ cat >upretty_printer.ml < let f () = Uast.Identifier.create () > EOF $ mkdir bin $ cat >bin/dune < (executable > (name use) > (libraries $lib)) > EOF $ cat >bin/use.ml < let () = Upretty_printer.f () > EOF Build in development mode: $ dune exec bin/use.exe And now in release $ dune exec bin/use.exe --release 2>&1 | grep -v "cd _build" [1]