Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document re_export field #3661

Merged
merged 3 commits into from
Jul 30, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,20 @@ all the literals evaluate to true. It is an error if none of the clauses are
selectable. You can add a fallback by adding a clause of the form ``(->
<file>)`` at the end of the list.

Re-exported dependencies
------------------------

A dependency ``foo`` may be marked as *re-exportable* using the following
syntax:

.. code:: scheme

(re_export foo)

This states that this library explicitly re-exports the interface of ``foo``.
This is primarily useful when :ref:`implicit transitive dependencies<implicit_transitive_deps>`
are disallowed, so it's documented along with the general feature.
This conversation was marked as resolved.
Show resolved Hide resolved

.. _preprocessing-spec:

Preprocessing specification
Expand Down
12 changes: 12 additions & 0 deletions doc/dune-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ Note that you must use ``threads.posix`` instead of ``threads`` when using this
mode. This is not an important limitation as ``threads.vm`` are deprecated
anyways.

In some situations, it's desirable to selectively preserve the behavior of
transitive dependencies being available to users of a library. For example, if
we define a library ``foo_more``, that extends ``foo``, we'd like users of
``foo_more`` to immediately have ``foo`` available as well. To do this, we must
This conversation was marked as resolved.
Show resolved Hide resolved
define the dependency on ``foo`` as re-exported:

.. code:: scheme

(library
(name foo_more)
(libraries (re_export foo)))

.. _wrapped-executables:

wrapped_executables
Expand Down