Skip to content

Commit 12dd80a

Browse files
committed
Clean up multilib documentation
Or more accurately, clean up documentation of other sections that imply multilib doesn't exist yet.
1 parent 4a99076 commit 12dd80a

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

doc/cabal-package.rst

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Package Description
44
The Cabal package is the unit of distribution. When installed, its
55
purpose is to make available:
66

7-
- One or more Haskell programs.
7+
- One or more Haskell programs (executables).
88

9-
- At most one library, exposing a number of Haskell modules.
9+
- One or more libraries, exposing a number of Haskell modules.
1010

1111
However having both a library and executables in a package does not work
1212
very well; if the executables depend on the library, they must
@@ -801,15 +801,16 @@ Library
801801

802802
Build information for libraries.
803803

804-
Currently, there can only be one publicly exposed library in a
805-
package, and its name is the same as package name set by global
806-
:pkg-field:`name` field. In this case, the ``name`` argument to
807-
the :pkg-section:`library` section must be omitted.
804+
A package can have one default library, which is identified by omitting the
805+
``name`` argument.
808806

809-
Starting with Cabal 2.0, private internal sub-library components
810-
can be defined by setting the ``name`` field to a name
811-
different from the current package's name; see section on
812-
:ref:`Internal Libraries <sublibs>` for more information.
807+
Starting with Cabal 2.0, sub-library components can be defined by setting
808+
the ``name`` field to a name different from the current package's name; see
809+
section on :ref:`Internal Libraries <sublibs>` for more information. By
810+
default, these sub-libraries are private and internal. Since Cabal 3.0,
811+
these sub-libraries can also be exposed and used by other packages. See the
812+
:pkg-field:`library:visibility` field and :ref:`Multiple Public Libraries
813+
<publicsublibs>` for more information.
813814

814815
The library section should contain the following fields:
815816

@@ -1005,7 +1006,9 @@ a real-world use case:
10051006
specify an internal library in a ``build-depends:`` section is
10061007
``package-name:internal-library-name``.
10071008

1008-
**Multiple public libraries**
1009+
.. _publicsublibs:
1010+
1011+
**Multiple Public Libraries**
10091012

10101013
Cabal 3.0 and later support exposing multiple libraries from a single package
10111014
through the field :pkg-field:`library:visibility`.
@@ -1629,7 +1632,7 @@ system-dependent values for these fields.
16291632
Multiple libraries from the same package can be specified with the shorthand
16301633
syntax ``pkg:{lib1,lib2}```.
16311634

1632-
See section on :ref:`Internal Libraries <sublibs>` for examples and more
1635+
See section on :ref:`Multiple Public Libraries <publicsublibs>` for examples and more
16331636
information.
16341637

16351638
**Version Constraints**

0 commit comments

Comments
 (0)