Commit 12a49040 authored by Toon Nolten's avatar Toon Nolten Committed by Daniel Gröber (dxld)

Improve hs-source-dirs documentation (#6225)

* Add deprecated hs-source-dir

I replaced the note about `hs-source-dir` being deprecated in the
description of `hs-source-dirs` by a field of its own to include the
`deprecated` and `removed` fields because it's no longer in 3.0.

* Add note to hs-source-dirs about multiple components

Source directories can be shared among components but there's a
non-obvious caveat which I've tried to clarify with a note.

* Clarify shared source dir note

Modules in a shared source directory can inadvertently end up getting
compiled multiple times.

[ci skip]
parent 8749f214
......@@ -2184,14 +2184,28 @@ system-dependent values for these fields.
:pkg-field:`other-modules`, :pkg-field:`library:exposed-modules` or
:pkg-field:`executable:main-is` fields.
.. pkg-field:: hs-source-dir: directory list
:deprecated: 2.0
:removed: 3.0
:default: ``.``
Root directories for the module hierarchy.
Deprecated in favor of :pkg-field:`hs-source-dirs`.
.. pkg-field:: hs-source-dirs: directory list
:default: ``.``
Root directories for the module hierarchy.
For backwards compatibility, the old variant ``hs-source-dir`` is
also recognized.
.. note::
Components can share source directories but modules found there will be
recompiled even if other components already built them, i.e., if a
library and an executable share a source directory and the executable
depends on the library and imports its ``Foo`` module, ``Foo`` will be
compiled twice, once as part of the library and again for the executable.
.. pkg-field:: default-extensions: identifier list
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment