env --- The ``env`` stanza allows one to modify the environment. The syntax is as follows: .. code:: dune (env ( ) ( ) ... ( )) The first form ``( )`` that corresponds to the selected build profile will be used to modify the environment in this directory. You can use ``_`` to match any build profile. Fields supported in ```` are: - any OCaml flags field. See :doc:`/concepts/ocaml-flags` for more details. - ``(link_flags )`` specifies flags to OCaml when linking an executable. See :ref:`executables stanza `. - ``(c_flags )`` and ``(cxx_flags )`` specify compilation flags for C and C++ stubs, respectively. See :doc:`library` for more details. - ``(env-vars ( ) .. ( ))`` will add the corresponding variables to the environment where the build commands are executed and are used by ``dune exec``. - ``(menhir_flags ))`` specifies flags for Menhir stanzas. This flag was replaced by the ``(menhir)`` field (see below) starting in version 3.0 of the Menhir extension. - ``(menhir (flags ) (explain ))`` specifies the Menhir settings. See :doc:`menhir` for more details. This field was introduced in version 3.0 of the Menhir extension. - ``(js_of_ocaml (flags )(build_runtime )(link_flags ))`` specifies ``js_of_ocaml`` flags. See :ref:`jsoo-field` for more details. - ``(js_of_ocaml (compilation_mode ))`` controls whether to use separate compilation or not where ```` is either ``whole_program`` or ``separate``. - ``(js_of_ocaml (sourcemap ))`` controls whether to generate sourcemap or not where ```` is either ``no``, ``file`` (to generate sourcemap in a ``.map`` file next the the generated javascript file) or ``inline`` (to inline the sourcemap at the end of the generated JavaScript file). - ``(js_of_ocaml (runtest_alias ))`` specifies the alias under which :ref:`inline_tests` and tests (:ref:`tests-stanza`) run for the ``js`` mode. - ``(js_of_ocaml (enabled_if ))`` specifies whether the ``js`` mode is enabled. It is enabled by default. - ``(wasm_of_ocaml (flags )(build_runtime )(link_flags ))`` specifies ``wasm_of_ocaml`` flags. See :ref:`wasmoo-field` for more details. - ``(wasm_of_ocaml (compilation_mode ))`` controls whether to use separate compilation or not where ```` is either ``whole_program`` or ``separate``. - ``(wasm_of_ocaml (sourcemap ))`` controls whether to generate sourcemap or not where ```` is either ``no``, ``file`` (to generate sourcemap in a ``.map`` file next the the generated javascript file) or ``inline`` (to inline the sourcemap at the end of the generated JavaScript file). - ``(wasm_of_ocaml (runtest_alias ))`` specifies the alias under which :ref:`inline_tests` and tests (:ref:`tests-stanza`) run for the ``wasm`` mode. - ``(wasm_of_ocaml (enabled_if ))`` specifies whether the ``wasm`` mode is enabled. It is enabled by default. - ``(binaries )``, where ```` is a list of entries of the form ``( as )``. ``( as )`` makes the binary ```` available in the command search as just ````. For instance, in a ``(run ...)`` action, ```` will resolve to this file path. You can also write just the file path, in which case the name will be inferred from the basename of ```` by dropping the ``.exe`` suffix, if it exists. For example, ``(binaries bin/foo.exe (bin/main.exe as bar))`` would add the commands ``foo`` and ``bar`` to the search path. - ``(inline_tests )``, where ```` is either ``enabled``, ``disabled``, or ``ignored``. This field has been available since Dune 1.11. It controls the variable's value ``%{inline_tests}``, which is read by the inline test framework. The default value is ``disabled`` for the ``release`` profile and ``enabled`` otherwise. - ``(odoc )`` allows passing options to ``odoc``. See :ref:`odoc-options` for more details. - ``(coq )`` allow passing options to Coq. See :ref:`coq-env` for more details. - ``(formatting )`` allows the user to set auto-formatting in the current directory subtree (see :doc:`/reference/dune-project/formatting`). - ``(bin_annot )`` allows the user to specify whether to generate `*.cmt` and `*.cmti` in the current directory subtree.