Skip to content

Commit c0a1a79

Browse files
committed
Prefer 'project package' to 'local package', consistently
1 parent eff7f3b commit c0a1a79

13 files changed

+147
-116
lines changed

ChangeLog.md

+9-8
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Other enhancements:
6868
`1.24.0.0`.
6969
* Experimental: Add flag `--haddock-for-hackage` to Stack's `build` command
7070
(including the `haddock` synonym for `build --haddock`) to enable building
71-
local packages with flags to generate Haddock documentation, and an archive
71+
project packages with flags to generate Haddock documentation, and an archive
7272
file, suitable for upload to Hackage. The form of the Haddock documentation
7373
generated for other packages is unaffected.
7474
* Experimental: Add flag `--documentation` (`-d` for short) to Stack's `upload`
@@ -89,7 +89,7 @@ Other enhancements:
8989
key is introduced, to allow the notification to be muted if unwanted.
9090
* Add option `--filter <item>` to Stack's `ls dependencies text` command to
9191
filter out an item from the results, if present. The item can be `$locals` for
92-
all local packages.
92+
all project packages.
9393
* Add option `--snapshot` as synonym for `--resolver`.
9494
* Add the `config set snapshot` command, corresponding to the
9595
`config set resolver` command.
@@ -222,8 +222,9 @@ Other enhancements:
222222
`c2hs`, `cpphs`, `gcc`, `greencard`, `happy`, `hsc2hs`, `hscolour`, `ld`,
223223
`pkg-config`, `strip` and `tar`. If Cabal uses the program during the
224224
configuration step, the argument is passed to it.
225-
* By default all `--PROG-option` options are applied to all local packages. This
226-
behaviour can be changed with new configuration option `apply-prog-options`.
225+
* By default all `--PROG-option` options are applied to all project packages.
226+
This behaviour can be changed with new configuration option
227+
`apply-prog-options`.
227228
* Add flag `--[no-]use-root` to `stack script` (default disabled). Used with
228229
`--compile` or `--optimize`, when enabled all compilation outputs (including
229230
the executable) are written to a script-specific location in the `scripts`
@@ -243,8 +244,8 @@ Bug fixes:
243244
* `stack build` with `--file-watch` or `--file-watch-poll` outputs 'pretty'
244245
error messages, as intended. See
245246
[#5978](https://github.com/commercialhaskell/stack/issues/5978).
246-
* `stack build` unregisters any local packages for the sub libraries of a local
247-
package that is to be unregistered. See
247+
* `stack build` unregisters any project packages for the sub libraries of a
248+
project package that is to be unregistered. See
248249
[#6046](https://github.com/commercialhaskell/stack/issues/6046).
249250
* The warning that sublibrary dependency is not supported is no longer triggered
250251
by internal libraries.
@@ -731,7 +732,7 @@ Other enhancements:
731732
affect the Stackage Curator use case, but there is now an additional message
732733
letting the user know when a previously-failed test case is being rerun.
733734

734-
* Move configure information for local packages back to .stack-work to improve
735+
* Move configure information for project packages back to .stack-work to improve
735736
caching. See
736737
[#4893](https://github.com/commercialhaskell/stack/issues/4893).
737738

@@ -917,7 +918,7 @@ Other enhancements:
917918

918919
* Support MX Linux in get-stack.sh. Fixes
919920
[#4769](https://github.com/commercialhaskell/stack/issues/4769).
920-
* Defer loading up of files for local packages. This allows us to get
921+
* Defer loading up of files for project packages. This allows us to get
921922
plan construction errors much faster, and avoid some unnecessary
922923
work when only building a subset of packages. This is especially
923924
useful for the curator use case.

doc/GUIDE.md

+15-13
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,11 @@ dependencies, and so on. Our value here says to use
261261
available to Stack). There are a number of values you can use for `resolver`,
262262
which we'll cover later.
263263

264-
The value of the `packages` key tells Stack which local packages to build. In
265-
our simple example, we have only a single package in our project, located in the
266-
same directory, so '`.`' suffices. However, Stack has powerful support for
267-
multi-package projects, which we'll elaborate on as this guide progresses.
264+
The value of the `packages` key tells Stack which project packages, located
265+
locally, to build. In our simple example, we have only a single project package,
266+
located in the same directory, so '`.`' suffices. However, Stack has powerful
267+
support for multi-package projects, which we'll elaborate on as this guide
268+
progresses.
268269

269270
Another file important to the build is `package.yaml`.
270271

@@ -404,9 +405,9 @@ stack build
404405
~~~
405406

406407
This output means that the `text` package was downloaded, configured, built, and
407-
locally installed. Once that was done, we moved on to building our local package
408-
(`helloworld`). At no point did we need to ask Stack to build dependencies — it
409-
does so automatically.
408+
locally installed. Once that was done, we moved on to building our project
409+
package (`helloworld`). At no point did we need to ask Stack to build
410+
dependencies — it does so automatically.
410411

411412
### Listing Dependencies
412413

@@ -943,18 +944,18 @@ different types of arguments:
943944
version, e.g. `stack build yesod-bin-1.4.14`.
944945
* This is almost identical to specifying a package name, except it will (1)
945946
choose the given version instead of latest, and (2) error out if the given
946-
version conflicts with the version of a local package.
947+
version conflicts with the version of a project package.
947948
* The most flexibility comes from specifying individual *components*, e.g.
948949
`stack build helloworld:test:helloworld-test` says "build the test suite
949950
component named helloworld-test from the helloworld package."
950951
* In addition to this long form, you can also shorten it by skipping what
951952
type of component it is, e.g. `stack build helloworld:helloworld-test`, or
952953
even skip the package name entirely, e.g. `stack build :helloworld-test`.
953954
* Finally, you can specify individual *directories* to build to trigger building
954-
of any local packages included in those directories or subdirectories.
955+
of any project packages included in those directories or subdirectories.
955956

956957
When you give no specific arguments on the command line (e.g., `stack build`),
957-
it's the same as specifying the names of all of your local packages. If you
958+
it's the same as specifying the names of all of your project packages. If you
958959
just want to build the package for the directory you're currently in, you can
959960
use `stack build .`.
960961

@@ -1083,9 +1084,10 @@ modified version of a dependency that hasn't yet been released upstream.
10831084
!!! note
10841085

10851086
When adding upstream packages directly to your project it is important to
1086-
distinguish _local packages_ from the upstream _dependency packages_.
1087-
Otherwise you may have trouble running `stack ghci`. See
1088-
[stack.yaml documentation](yaml_configuration.md#packages) for more details.
1087+
distinguish _project packages_ located locally from the upstream
1088+
_dependency packages_. Otherwise you may have trouble running `stack ghci`.
1089+
See [stack.yaml documentation](yaml_configuration.md#packages) for more
1090+
details.
10891091

10901092
## Flags and GHC options
10911093

doc/build_command.md

+18-17
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ run. The running behaviour can be disabled with the `--no-run-tests` flag.
6363
Similarly, if a benchmark component is targeted, it is built and run unless the
6464
running behaviour is disabled with the `--no-run-benchmarks` flag.
6565

66-
This ability to specify a component applies only to a local package. With
66+
This ability to specify a component applies only to a project package. With
6767
dependencies, Stack will *always* build the library (if present) and all
6868
executables (if any), and ignore test suites and benchmarks. If you want more
6969
control over a package, you must add it to your `packages` setting in your
@@ -75,15 +75,15 @@ project-level configuration file (`stack.yaml`).
7575
supported syntaxes for targets are:
7676

7777
* *package*, e.g. `stack build foobar`, is the most commonly used target. It
78-
will try to find the package in the following locations: local packages,
78+
will try to find the package in the following locations: project packages,
7979
extra deps, snapshots, and package index (e.g. Hackage). If it's found in
8080
the package index, then the latest version of that package from the index is
8181
implicitly added to your extra dependencies.
8282

83-
If the package is a local package, the library and executable components are
84-
selected to be built. If the `--test` and `--bench` flags are set, then all
85-
of the test suite and benchmark components, respectively, are selected to be
86-
built.
83+
If the package is a project package, the library and executable components
84+
are selected to be built. If the `--test` and `--bench` flags are set, then
85+
all of the test suite and benchmark components, respectively, are selected
86+
to be built.
8787

8888
If *package* is a GHC boot package (packages that come with GHC and are
8989
included in GHC's global package database), the behaviour can be complex.
@@ -97,7 +97,7 @@ supported syntaxes for targets are:
9797
include directly most boot packages but some snapshots may include directly
9898
some boot packages. In particular, some snapshots include directly `Win32`
9999
(which is a boot package on Windows) while others do not. For example, if
100-
`Cabal` (a boot package) is not a local package or an extra dep, then
100+
`Cabal` (a boot package) is not a project package or an extra-dep, then
101101
`stack build Cabal` with Stackage snapshot LTS Haskell 20.25 will:
102102

103103
* on Windows, try to build the latest version of `Cabal` in the package
@@ -109,7 +109,7 @@ supported syntaxes for targets are:
109109
* *package identifier*, e.g. `stack build foobar-1.2.3`, is usually used to
110110
include specific package versions from the package index.
111111

112-
If the package name conflicts with that of a local package, then Stack
112+
If the package name conflicts with that of a project package, then Stack
113113
fails with an error.
114114

115115
Otherwise, this is the same as using `stack build foobar` (that is, ignoring
@@ -140,11 +140,11 @@ supported syntaxes for targets are:
140140
example, `stack build mypackage:mytestsuite`.
141141

142142
* `:<comp-name>` is a useful shortcut, saying "find the component
143-
`<comp-name>` in all of the local packages". This will result in an
143+
`<comp-name>` in all of the project packages". This will result in an
144144
error if more than one package has a component with the specified name.
145145
To continue the above example, `stack build :mytestsuite`.
146146

147-
* *directory*, e.g. `stack build foo/bar`, will find all local packages that
147+
* *directory*, e.g. `stack build foo/bar`, will find all project packages that
148148
exist in the given directory hierarchy and then follow the same procedure as
149149
passing in package names as mentioned above. There's an important caveat
150150
here: if your directory name is parsed as one of the above target types, it
@@ -153,10 +153,10 @@ supported syntaxes for targets are:
153153

154154
!!! note
155155

156-
`stack build .` will target local packages in the current working
156+
`stack build .` will target project packages in the current working
157157
directory or its subdirectories.
158158

159-
`stack build` with no targets specified will build all local packages.
159+
`stack build` with no targets specified will build all project packages.
160160

161161
For further information about available targets, see the
162162
[`stack ide targets` command](ide_command.md).
@@ -267,11 +267,11 @@ Unset the flag to disable building Haddock documentation for dependencies.
267267

268268
Default: Disabled
269269

270-
Set the flag to build local packages with flags to generate Haddock
270+
Set the flag to build project packages with flags to generate Haddock
271271
documentation suitable for upload to Hackage. The form of the Haddock
272272
documentation generated for other packages is unaffected.
273273

274-
For each local package:
274+
For each project package:
275275

276276
* the generated Haddock documentation files are in directory
277277
`doc\html\<package_version>-docs\`, relative to Stack's dist work directory
@@ -383,7 +383,7 @@ particular when they depend on external data files.
383383
### `--skip` option
384384

385385
`stack build --skip <component>` skips building the specified components of a
386-
local package. It allows you to skip test suites and benchmark without
386+
project package. It allows you to skip test suites and benchmark without
387387
specifying other components (e.g. `stack test --skip long-test-suite` will run
388388
the tests without the `long-test-suite` test suite). Be aware that skipping
389389
executables won't work the first time the package is built due to an issue in
@@ -414,7 +414,8 @@ using events to determine if a file has changed.
414414
[:octicons-tag-24: 2.5.1](https://github.com/commercialhaskell/stack/releases/tag/v2.5.1)
415415

416416
Pass the flag to rebuild your project every time any local file changes (from
417-
project packages or from local dependencies). See also the `--file-watch` flag.
417+
project packages or from dependencies located locally). See also the
418+
`--file-watch` flag.
418419

419420
## Controlling what happens after building
420421

@@ -574,7 +575,7 @@ used by Cabal during the configuration step, you could command
574575
to `happy` its `--ghc` flag.
575576

576577
By default, all and any `--PROG-option` options on Stack's command line are
577-
applied to all local packages (targets or otherwise). This behaviour can be
578+
applied to all project packages (targets or otherwise). This behaviour can be
578579
changed. See the
579580
[`apply-prog-options`](yaml_configuration.md#apply-prog-options) configuration
580581
option.

doc/config_command.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ stack config env [--[no-]locals] [--[no-]ghc-package-path] [--[no-]stack-exe]
2323
`stack config env` outputs a script that sets or unsets environment variables
2424
for a Stack environment. Flags modify the script that is output:
2525

26-
* `--[no-]locals` (enabled by default) include/exclude local package information
26+
* `--[no-]locals` (enabled by default) include/exclude project package
27+
information
2728
* `--[no-]ghc-package-path` (enabled by default) set `GHC_PACKAGE_PATH`
2829
environment variable or not
2930
* `--[no-]stack-exe` (enabled by default) set `STACK_EXE` environment variable

doc/faq.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,9 @@ doesn't lead to a rebuild, add the `-fforce-recomp` flag to your
427427

428428
## Why doesn't Stack apply my `--ghc-options` to my dependencies?
429429

430-
By default, Stack applies command line GHC options only to local packages (these
431-
are all the packages that are specified in the `packages` section of your
432-
`stack.yaml` file). For an explanation of this choice see this discussion on
433-
issue
430+
By default, Stack applies command line GHC options only to
431+
[project packages](yaml_configuration.md#packages). For an explanation of this
432+
choice see this discussion on issue
434433
[#827](https://github.com/commercialhaskell/stack/issues/827#issuecomment-133263678).
435434

436435
If you still want to set specific GHC options for a dependency, use the

doc/global_flags.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ further information see `stack --docker-help` or the
5454

5555
Default: Dump warning logs
5656

57-
Enables/disables the dumping of the build output logs for local packages to the
58-
console. For further information, see the documentation for the corresponding
59-
non-project specific configuration [option](yaml_configuration.md#dump-logs).
57+
Enables/disables the dumping of the build output logs for project packages to
58+
the console. For further information, see the documentation for the
59+
corresponding non-project specific configuration
60+
[option](yaml_configuration.md#dump-logs).
6061

6162
## `--extra-include-dirs` option
6263

doc/glossary.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The following terms are used in Stack's documentation.
1212
|CI |Continuous integration. |
1313
|CMake |A [system](https://cmake.org/) for managing build processes.|
1414
|`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.|
1516
|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_.|
1617
|Emacs |[GNU Emacs](https://www.gnu.org/software/emacs/), an extensible, customisable text editor.|
1718
|extra-deps |Packages (one version of each) that add to, or amend, those specified in a snapshot. Named after a key used in `stack.yaml` files.|
@@ -40,7 +41,8 @@ The following terms are used in Stack's documentation.
4041
|`package.yaml` |A file that describes a package in the Hpack format. |
4142
|Pantry |A library for content-addressable Haskell package management, provided by the [`pantry` package](https://hackage.haskell.org/package/pantry). A dependency of Stack.|
4243
|PATH |The `PATH` environment variable, specifying a list of directories searched for executable files.|
43-
|project |A Stack project is a local directory that contains a project-level configuration file (`stack.yaml`). A project may relate to more than one local package.|
44+
|project |A Stack project is a local directory that contains a project-level configuration file (`stack.yaml`). A project may relate to more than one project package.|
45+
|project package |A Haskell package that is part of a project and located locally. Distinct from a dependency located locally.|
4446
|PVP |The Haskell [Package Versioning Policy](https://pvp.haskell.org/), which tells developers of libraries how to set their version numbers.|
4547
|REPL |An interactive (run-eval-print loop) programming environment.|
4648
|resolver |A synonym for snapshot. |

doc/hpc_command.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ This report will consider all test results as well as the newly generated
9090

9191
`stack test --coverage` is quite streamlined for the following use-case:
9292

93-
1. You have test suites which exercise your local packages.
93+
1. You have test suites which exercise your project packages.
9494

9595
2. These test suites link against your library, rather than building the
9696
library directly. Coverage information is only given for libraries, ignoring
@@ -119,12 +119,12 @@ When your project has these properties, you will get the following:
119119
Most users can get away with just understanding the above documentation.
120120
However, advanced users may want to understand exactly how `--coverage` works:
121121

122-
1. The GHC option `-fhpc` gets passed to all local packages. This tells GHC to
122+
1. The GHC option `-fhpc` gets passed to all project packages. This tells GHC to
123123
output executables that track coverage information and output them to `.tix`
124124
files. `the-exe-name.tix` files will get written to the working directory of
125125
the executable.
126126

127-
When switching on this flag, it will usually cause all local packages to be
127+
When switching on this flag, it will usually cause all project packages to be
128128
rebuilt (see issue
129129
[#1940](https://github.com/commercialhaskell/stack/issues/1940)).
130130

@@ -145,7 +145,7 @@ However, advanced users may want to understand exactly how `--coverage` works:
145145
the modules compiled in the `executable` or `test-suite` stanza of your Cabal
146146
file. This makes it possible to directly union multiple `*.tix` files from
147147
different executables (assuming they are using the exact same versions of the
148-
local packages).
148+
project packages).
149149

150150
If there is enough popular demand, it may be possible in the future to give
151151
coverage information for modules that are compiled directly into the

doc/ide_command.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ commands.
2020
stack ide packages [--stdout] [--cabal-files]
2121
~~~
2222

23-
`stack ide packages` lists all available local packages that are loadable.
23+
`stack ide packages` lists all available project packages that are loadable.
2424

2525
By default:
2626

doc/lock_files.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ project, snapshot packages and snapshots themselves so that:
2121

2222
* These files can be stored in source control
2323
* Users on other machines can reuse these lock files and get identical build
24-
plans given that the used local packages and local snapshots are the same on
24+
plans given that the used project packages and local snapshots are the same on
2525
those machines
2626
* Rerunning `stack build` in the future is deterministic in the build plan, not
2727
depending on mutable state in the world like Hackage revisions

0 commit comments

Comments
 (0)