implicit_transitive_deps¶
- (implicit_transitive_deps <setting>)
Control whether transitive dependencies are made implicitly visible during compilation.
<setting>is one of:truemakes transitive dependencies implicitly visible. This is the default.falseonly listed dependencies are visible. If the-Hflag is supported by the compiler (OCaml version >= 5.2) and Dune language version is >= 1.17, Dune will pass the flag to the compiler, which avoids some corner cases (see below).false-if-hidden-includes-supportedonly listed dependencies are visible if the compiler supports the-Hflag. Otherwise (OCaml version < 5.2), the setting is ignored and all transitive dependencies are made visible. Introduced in Dune 3.20.
(implicit_transitive_deps false)
Then all dependencies directly used by a library or an executable must be added in the
librariesfield.We recommend users experiment with this mode and report any problems.
Note that if
-Hflag is not being used, you must usethreads.posixinstead ofthreadswhen using this mode. This isn’t an important limitation, asthreads.vmis deprecated anyway.In some situations, it can be desirable to selectively preserve the behavior of transitive dependencies’ availability a library’s users. For example, if we define a library
foo_morethat extendsfoo, we might wantfoo_moreusers to immediately havefooavailable as well. To do this, we must define the dependency onfooas re-exported:(library (name foo_more) (libraries (re_export foo)))