Skip to content

Commit fa07810

Browse files
committed
Improve docs about GHC wired-in packages
1 parent 3f71eeb commit fa07810

File tree

3 files changed

+71
-54
lines changed

3 files changed

+71
-54
lines changed

doc/configure/yaml/project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ An extra-dep will shadow a dependency specified in a [snapshot](#snapshot) of
186186
the same name. An extra-dep can be shadowed by a [project package](#packages) of
187187
the same name.
188188

189-
!!! info
189+
!!! info "GHC wired-in packages"
190190

191191
Some Haskell packages published on Hackage, for example `base` and `ghc`,
192192
are referred to as 'wired-in' to one or more versions of GHC or as 'magic'.

doc/faq.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,22 @@
330330
boot package of the specified version of GHC. The boot package of GHC 9.8.1
331331
and 9.8.2 is `Cabal-3.10.2.0`.
332332

333+
??? question "What causes dependency on multiple versions of the same package?"
334+
335+
When building a package, during its configuration, Stack may warn:
336+
337+
~~~text
338+
This package indirectly depends on multiple versions of the same package.
339+
This is very likely to cause a compile failure.
340+
~~~
341+
342+
and the build subsequently fails.
343+
344+
Often the cause is that: (1) the package depends, directly or indirectly, on
345+
a GHC wired-in package (for example, the `ghc` package); and (2) a direct or
346+
indirect dependency of that wired-in package is also specified as an
347+
extra-dep but the versions differ.
348+
333349
??? question "Why does `stack test` trigger a rebuild of other components?"
334350

335351
If the set of dependencies of a project package to be built are not a

doc/glossary.md

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,60 @@
44

55
The following terms are used in Stack's documentation.
66

7-
|Term |Meaning |
8-
|-------------------|----------------------------------------------------------|
9-
|Cabal |The Haskell Common Architecture for Building Applications and Libraries, provided by the [`Cabal` package](https://hackage.haskell.org/package/Cabal). Also referred to as Cabal (the library) to distinguish it from Cabal (the tool).|
10-
|Cabal file|A file containing a [package description](https://cabal.readthedocs.io/en/stable/cabal-package-description-file.html) used by Cabal, named `<package_name>.cabal`.|
11-
|Cabal (the tool)|The Haskell tool used for building provided by the [`cabal-install` package](https://hackage.haskell.org/package/cabal-install).|
12-
|CI |Continuous integration. |
13-
|CMake |A [system](https://cmake.org/) for managing build processes.|
14-
|`config.yaml` |A global and non-project-specific configuration file used by Stack.|
15-
|dependency |A Haskell package other than a project package and on which a project package depends (directly or indirectly), located locally or elsewhere.|
16-
|Docker |A [platform](https://www.docker.com/) for developing, shipping, and running applications. It can package and run an application in a loosely isolated environment called a _container_.|
17-
|Emacs |[GNU Emacs](https://www.gnu.org/software/emacs/), an extensible, customisable text editor.|
18-
|extra-deps |Extra dependencies (one version of each) that add to, or shadow, those specified in a snapshot.|
19-
|FreeBSD |A Unix-like operating system. |
20-
|GCC |The [GNU Compiler Collection](https://gcc.gnu.org/) or its executable `gcc`.|
21-
|GHC |The [Glasgow Haskell Compiler](https://www.haskell.org/ghc/).|
22-
|GHC boot package |A package that comes with GHC, is included in GHC's global package database, and is not included in a Stackage snapshot. See the output of command `stack exec -- ghc-pkg list --global`.|
23-
|GHCi |GHC's [interactive environment](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html).|
24-
|GHCJS |A Haskell to JavaScript [compiler](https://github.com/ghcjs/ghcjs).|
25-
|GHCup |An [installer](https://www.haskell.org/ghcup/) for Haskell.
26-
|Git |A [distributed version control system](https://git-scm.com/).|
27-
|GPG |The [GNU Privacy Guard](https://gnupg.org/) or GnuPG, software that allows you to encrypt or sign your data and communications.|
28-
|Hackage |The [Haskell Package Repository](https://hackage.haskell.org/).
29-
|Haddock |The [document generation tool](https://hackage.haskell.org/package/haddock) for Haskell libraries.|
30-
|'Haskell' extension|The ['Haskell' extension]() for VS Code. |
31-
|HLS |[Haskell Language Server](https://haskell-language-server.readthedocs.io/en/latest/), an implementation of the Language Server Protocol for Haskell.|
32-
|Homebrew |A [package manager](https://brew.sh/) for macOS or Linux, or its executable `brew`.|
33-
|Hoogle |A Haskell API [search engine](https://hoogle.haskell.org/).|
34-
|Hpack |A [format](https://github.com/sol/hpack) for Haskell packages or the executable `hpack` that produces a Cabal file from `package.yaml`.|
35-
|Linux |A family of operating systems based on the Linux kernel. |
36-
|macOS |The primary operating system for Apple's Mac computers. Previously known as Mac OS X or OS X.|
37-
|Make |A [build automation tool](https://www.gnu.org/software/make/).|
38-
|Markdown |A plain text [formatting syntax](https://daringfireball.net/projects/markdown/) or software used to convert files in that format to HTML.|
39-
|MSYS2 |The [MSYS2](https://www.msys2.org/) software distribution and building platform for Windows.|
40-
|Nix |A purely functional [package manager](https://nixos.org/), available for Linux and macOS.|
41-
|package |A Haskell package is an organised collection of Haskell code and related files. It is described by a Cabal file or a `package.yaml` file, which is itself part of the package.|
42-
|`package.yaml` |A file that describes a package in the Hpack format. |
43-
|Pantry |A library for content-addressable Haskell package management, provided by the [`pantry` package](https://hackage.haskell.org/package/pantry). A dependency of Stack.|
44-
|PATH |The `PATH` environment variable, specifying a list of directories searched for executable files.|
45-
|project |A Stack project is a local directory that contains a project-level configuration file (`stack.yaml`, by default). A project may relate to more than one project package.|
46-
|project package |A Haskell package that is part of a project and located locally. Distinct from a dependency located locally.|
47-
|PVP |The Haskell [Package Versioning Policy](https://pvp.haskell.org/), which tells developers of libraries how to set their version numbers.|
48-
|REPL |An interactive (run-eval-print loop) programming environment.|
49-
|resolver |A synonym for snapshot. |
50-
|`Setup.hs` |A project-specific file used by Cabal to perform setup tasks.|
51-
|snapshot |A snapshot defines a GHC version, a set of packages (one version of each), and build flags or other settings.|
52-
|Stack |The Haskell Tool Stack project or its executable `stack`. |
53-
|`stack.yaml` |A project-level configuration file used by Stack, which may also contain non-project-specific options.|
54-
|Stackage |A [distribution](https://www.stackage.org/) of compatible Haskell packages.|
55-
|Stack root |A directory in which Stack stores important files. See `stack path --stack-root`. On Windows, or if Stack is configured to use the XDG Base Directory Specification, Stack also stores important files outside of the Stack root.|
7+
|Term |Meaning |
8+
|--------------------|---------------------------------------------------------|
9+
|Cabal |The Haskell Common Architecture for Building Applications and Libraries, provided by the [`Cabal` package](https://hackage.haskell.org/package/Cabal). Also referred to as Cabal (the library) to distinguish it from Cabal (the tool).|
10+
|Cabal file |A file containing a [package description](https://cabal.readthedocs.io/en/stable/cabal-package-description-file.html) used by Cabal, named `<package_name>.cabal`.|
11+
|Cabal (the tool) |The Haskell tool used for building provided by the [`cabal-install` package](https://hackage.haskell.org/package/cabal-install).|
12+
|CI |Continuous integration. |
13+
|CMake |A [system](https://cmake.org/) for managing build processes.|
14+
|`config.yaml` |A global and non-project-specific configuration file used by Stack.|
15+
|dependency |A Haskell package other than a project package and on which a project package depends (directly or indirectly), located locally or elsewhere.|
16+
|Docker |A [platform](https://www.docker.com/) for developing, shipping, and running applications. It can package and run an application in a loosely isolated environment called a _container_.|
17+
|Emacs |[GNU Emacs](https://www.gnu.org/software/emacs/), an extensible, customisable text editor.|
18+
|extra-deps |Extra dependencies (one version of each) that add to, or shadow, those specified in a snapshot.|
19+
|FreeBSD |A Unix-like operating system. |
20+
|GCC |The [GNU Compiler Collection](https://gcc.gnu.org/) or its executable `gcc`.|
21+
|GHC |The [Glasgow Haskell Compiler](https://www.haskell.org/ghc/).|
22+
|GHC boot package |A package that comes with GHC, is included in GHC's global package database, and is not included in a Stackage snapshot. See the output of command `stack exec -- ghc-pkg list --global`.|
23+
|GHC wired-in package|A GHC boot package that cannot be shaddowed with different versions of the same package. Also referred to as 'magic'.|
24+
|GHCi |GHC's [interactive environment](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html).|
25+
|GHCJS |A Haskell to JavaScript [compiler](https://github.com/ghcjs/ghcjs).|
26+
|GHCup |An [installer](https://www.haskell.org/ghcup/) for Haskell.
27+
|Git |A [distributed version control system](https://git-scm.com/).|
28+
|GPG |The [GNU Privacy Guard](https://gnupg.org/) or GnuPG, software that allows you to encrypt or sign your data and communications.|
29+
|Hackage |The [Haskell Package Repository](https://hackage.haskell.org/).
30+
|Haddock |The [document generation tool](https://hackage.haskell.org/package/haddock) for Haskell libraries.|
31+
|'Haskell' extension |The ['Haskell' extension]() for VS Code. |
32+
|HLS |[Haskell Language Server](https://haskell-language-server.readthedocs.io/en/latest/), an implementation of the Language Server Protocol for Haskell.|
33+
|Homebrew |A [package manager](https://brew.sh/) for macOS or Linux, or its executable `brew`.|
34+
|Hoogle |A Haskell API [search engine](https://hoogle.haskell.org/).|
35+
|Hpack |A [format](https://github.com/sol/hpack) for Haskell packages or the executable `hpack` that produces a Cabal file from `package.yaml`.|
36+
|Linux |A family of operating systems based on the Linux kernel. |
37+
|macOS |The primary operating system for Apple's Mac computers. Previously known as Mac OS X or OS X.|
38+
|Make |A [build automation tool](https://www.gnu.org/software/make/).|
39+
|Markdown |A plain text [formatting syntax](https://daringfireball.net/projects/markdown/) or software used to convert files in that format to HTML.|
40+
|MSYS2 |The [MSYS2](https://www.msys2.org/) software distribution and building platform for Windows.|
41+
|Nix |A purely functional [package manager](https://nixos.org/), available for Linux and macOS.|
42+
|package |A Haskell package is an organised collection of Haskell code and related files. It is described by a Cabal file or a `package.yaml` file, which is itself part of the package.|
43+
|`package.yaml` |A file that describes a package in the Hpack format. |
44+
|Pantry |A library for content-addressable Haskell package management, provided by the [`pantry` package](https://hackage.haskell.org/package/pantry). A dependency of Stack.|
45+
|PATH |The `PATH` environment variable, specifying a list of directories searched for executable files.|
46+
|project |A Stack project is a local directory that contains a project-level configuration file (`stack.yaml`, by default). A project may relate to more than one project package.|
47+
|project package |A Haskell package that is part of a project and located locally. Distinct from a dependency located locally.|
48+
|PVP |The Haskell [Package Versioning Policy](https://pvp.haskell.org/), which tells developers of libraries how to set their version numbers.|
49+
|REPL |An interactive (run-eval-print loop) programming environment.|
50+
|resolver |A synonym for snapshot. |
51+
|`Setup.hs` |A project-specific file used by Cabal to perform setup tasks.|
52+
|snapshot |A snapshot defines a GHC version, a set of packages (one version of each), and build flags or other settings.|
53+
|Stack |The Haskell Tool Stack project or its executable `stack`.|
54+
|`stack.yaml` |A project-level configuration file used by Stack, which may also contain non-project-specific options.|
55+
|Stackage |A [distribution](https://www.stackage.org/) of compatible Haskell packages.|
56+
|Stack root |A directory in which Stack stores important files. See `stack path --stack-root`. On Windows, or if Stack is configured to use the XDG Base Directory Specification, Stack also stores important files outside of the Stack root.|
5657
|Stack work directory|A directory within a local project or package directory in which Stack stores files created during the build process. Named `.stack-work`, by default.|
5758
|Unix-like operating systems|Linux, FreeBSD and macOS. |
58-
|VS Code |[Visual Studio Code](https://code.visualstudio.com/), a source code editor.|
59-
|Windows |A group of operating systems developed by Microsoft. |
60-
|WSL |[Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/). Provides a Linux environment on Windows.|
59+
|VS Code |[Visual Studio Code](https://code.visualstudio.com/), a source code editor.|
60+
|Windows |A group of operating systems developed by Microsoft. |
61+
|WSL |[Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/). Provides a Linux environment on Windows.|
6162
|XDG Base Directory Specification|A [specification](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) of directories relative to which files should be located.|
62-
|YAML |A human-friendly [data serialization language](https://yaml.org/).|
63+
|YAML |A human-friendly [data serialization language](https://yaml.org/).|

0 commit comments

Comments
 (0)