Skip to content

Commit 333782e

Browse files
authored
Merge pull request #10824 from haskell/fix10819
Fix #10819 Document that executables etc can depend on library in same package
2 parents 7856872 + e7ff9be commit 333782e

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

doc/cabal-package-description-file.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1353,6 +1353,15 @@ system-dependent values for these fields.
13531353
from the same package can be specified with the shorthand syntax
13541354
``my-package:{my-library1,my-library2}``.
13551355

1356+
.. Note::
1357+
1358+
The :pkg-field:`build-depends` field of an executable section (from
1359+
version 1.8 of the Cabal specification), test suite section (from
1360+
version 1.10) or benchmark section (from version 1.14) can specify a
1361+
library in the same package by the name of the library (without a version
1362+
constraint). Cabal then treats the executable, test suite or benchmark as
1363+
if it were in another package that depended on the package.
1364+
13561365
.. Note::
13571366

13581367
Before version 3.4 of the Cabal specification, from version 2.0, a
@@ -2317,7 +2326,7 @@ Configurations
23172326

23182327
Library and executable sections may include conditional blocks, which
23192328
test for various system parameters and configuration flags. The flags
2320-
mechanism is rather generic, but most of the time a flag represents
2329+
mechanism is rather generic, but most of the time a flag represents a
23212330
certain feature, that can be switched on or off by the package user.
23222331
Here is an example package description file using configurations:
23232332

@@ -2378,8 +2387,9 @@ Example: A package containing a library and executable programs
23782387

23792388
Executable test1
23802389
Main-is: T1.hs
2381-
Other-Modules: Testing.Test1
2382-
Build-Depends: base >= 4.2 && < 4.9
2390+
Build-Depends:
2391+
, base >= 4.2 && < 4.9
2392+
, Test1
23832393
Default-Language: Haskell2010
23842394

23852395
if flag(debug)

0 commit comments

Comments
 (0)