Skip to content

Commit a52afb5

Browse files
authored
Merge pull request #5748 from commercialhaskell/stable
Stable
2 parents 5d245e2 + 61b16ee commit a52afb5

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

doc/faq.md

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,26 @@ directory. None of this should affect any existing Haskell tools at all.
4444

4545
## What is the relationship between stack and cabal?
4646

47-
* Cabal-the-library is used by stack to build your Haskell code. See the
48-
[Architecture: Plan Execution](architecture.md#plan-execution) section for
49-
more detail, including how the Cabal version is chosen.
50-
* A .cabal file is provided for each package, and defines all package-level
51-
metadata just like it does in the cabal-install world: modules, executables,
52-
test suites, etc. No change at all on this front.
53-
* A stack.yaml file references 1 or more packages, and provides information on
54-
where dependencies come from.
55-
* `stack build` currently initializes a stack.yaml from the existing .cabal
56-
file. Project initialization is something that is still being discussed and
57-
there may be more options here for new projects in the future (see issue
58-
[253](https://github.com/commercialhaskell/stack/issues/253))
47+
* 'Cabal' can refer to the `Cabal` library or to the `cabal` command-line tool
48+
(provided by the `cabal-install` package). Cabal-the-library is used by stack
49+
to build your Haskell code.
50+
* A `.cabal` file is provided for each package. It defines all package-level
51+
metadata, just like it does in the `cabal-install` world: modules,
52+
executables, test suites, etc. No change at all on this front.
53+
* A `stack.yaml` file references one or more packages, and provides information
54+
on where dependencies come from.
55+
* The `stack init` command initializes a `stack.yaml` file from an existing
56+
`.cabal` file.
57+
* Stack uses `Cabal` via an executable. For `build-type: Simple` (the most
58+
common case), stack builds that executable using the version of `Cabal` which
59+
came with the compiler. Stack caches such executables, in the stack root under
60+
folder `setup-exe-cache`.
61+
* In rare or complex cases, a different version of `Cabal` to the one that came
62+
with the compiler may be needed. `build-type: Custom` and a `setup-custom`
63+
stanza in the `.cabal` file, and a `Setup.hs` file in the package folder, can
64+
be specified. The `stack.yaml` file can then specify the version of `Cabal`
65+
that stack will use to build the executable (named `setup`) from `Setup.hs`.
66+
Stack will use `Cabal` via `setup`.
5967

6068
For detail on the differences between a `stack.yaml` and Cabal package file, see
6169
[stack.yaml vs cabal package file](stack_yaml_vs_cabal_package_file.md).

0 commit comments

Comments
 (0)