Skip to content

Commit 42c0c2b

Browse files
committed
add docs and changelog entry
1 parent bdd4594 commit 42c0c2b

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

changelog.d/pr-7851

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
synopsis: Better support for scripts
22
packages: cabal-install
3-
prs: #7851 #7925 #7938 #7990
4-
issues: #7842 #7073 #6354 #6149 #5508
3+
prs: #7851 #7925 #7938 #7990 #7997
4+
issues: #7842 #7073 #6354 #6149 #5508 #5698
55

66
description: {
77

@@ -15,5 +15,7 @@ description: {
1515
- The name of the generated script executable has been changed from "script" to
1616
"cabal-script-<your-sanitized-script-name>" for easier process management.
1717
- Reduce the default verbosity of scripts, so that the build output doesn't interfere with the script output.
18+
- Scripts now support a project metadata block that allows them to use options
19+
that would normally be set in a cabal.project file.
1820

1921
}

doc/cabal-commands.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,21 @@ a script that looks like:
465465

466466
#!/usr/bin/env cabal
467467
{- cabal:
468-
build-depends: base ^>= 4.11
469-
, shelly ^>= 1.8.1
468+
build-depends: base ^>= 4.14
469+
, shelly ^>= 1.10
470+
-}
471+
{- project:
472+
with-compiler: ghc-8.10.7
470473
-}
471474

472475
main :: IO ()
473476
main = do
474477
...
475478

479+
Where there cabal metadata block is mandatory and contains fields from a
480+
package executable block, and the project metadata block is optional and
481+
contains fields that would be in the cabal.project file in a regular project.
482+
476483
It can either be executed like any other script, using ``cabal`` as an
477484
interpreter, or through this command:
478485

0 commit comments

Comments
 (0)