Haddock: use buildSettingKeepTempFiles
[cabal.git] / release-notes / cabal-install-3.8.1.0.md
blob95565d936c73469861b18951a82b39e346f26283
1 cabal-install 3.8.1.0 Changelog
2 ---
4 ### Significant changes
6 - `Cabal-3.8.1.0` is used, which brings [its own set of changes](./Cabal-3.8.1.0.md),
7   many of which are significant.
9 - Expose `cabal-install` as library [#1597](https://github.com/haskell/cabal/issues/1597) [#3781](https://github.com/haskell/cabal/issues/3781) [#4798](https://github.com/haskell/cabal/issues/4798) [#6090](https://github.com/haskell/cabal/issues/6090) [#7224](https://github.com/haskell/cabal/issues/7224) [#7358](https://github.com/haskell/cabal/pull/7358)
10 - Split out package `cabal-install-solver`
12 - `cabal init` rewrite [#1074](https://github.com/haskell/cabal/issues/1074) [#6758](https://github.com/haskell/cabal/issues/6758) [#6864](https://github.com/haskell/cabal/issues/6864) [#7251](https://github.com/haskell/cabal/issues/7251) [#7255](https://github.com/haskell/cabal/issues/7255) [#7256](https://github.com/haskell/cabal/issues/7256) [#7273](https://github.com/haskell/cabal/issues/7273)
14   - Restructures the `cabal init` command to fix historical
15     issues. All flags are preserved.
16     - Codebases for interactive and non-interactive flags
17       are disentangled.
18     - Data structures now exploit relevant stanza structure
19       and formatters only care about stanza data.
20     - Heuristics and prompts have a pure and impure implementation.
22   - Sets default behavior to be `--interactive` as opposed to
23     `--non-interactive`.
25   - Rewrites tests to achieve 98% coverage
26     - Golden files now test every stanza individually.
27     - Every flag is covered by a unit test.
28     - Interactive, simple, and non-interactive workflows are
29       covered.
31 - Conditionals and imports in `cabal.project` files [#7556](https://github.com/haskell/cabal/issues/7556) [#7783](https://github.com/haskell/cabal/pull/7783)
33   `cabal.project` files now allow conditional logic on compiler version, arch, etc. as well as imports of other local or remote project of freeze files (both old and new style).
35 - Changes to `cabal v2-configure` [#5591](https://github.com/haskell/cabal/issues/5591) [#7180](https://github.com/haskell/cabal/issues/7180) [#7405](https://github.com/haskell/cabal/issues/7405) [#7402](https://github.com/haskell/cabal/pull/7402)
37   - removes the `--dry-run` part of the `v2-configure` command. now the command only generates a cabal.project.local. to get the old functionality back, run `cabal v2-build --dry-run` after (or instead of, if generating cabal.project.local is not needed) `v2-configure`
38   - add `--enable-append` and `--disable-append` flags to `v2-configure`, which toggle the option for the new configuration to be appended to the old config file
39   - add `--enable-backup` and `--disable-backup` flags to `v2-configure`, which toggle the backup feature for the configuration file
41 - Better support for scripts [#5508](https://github.com/haskell/cabal/issues/5508) [#5698](https://github.com/haskell/cabal/issues/5698) [#6149](https://github.com/haskell/cabal/issues/6149) [#6354](https://github.com/haskell/cabal/issues/6354) [#7073](https://github.com/haskell/cabal/issues/7073) [#7842](https://github.com/haskell/cabal/issues/7842) [#7851](https://github.com/haskell/cabal/pull/7851) [#7925](https://github.com/haskell/cabal/pull/7925) [#7938](https://github.com/haskell/cabal/pull/7938) [#7990](https://github.com/haskell/cabal/pull/7990) [#7997](https://github.com/haskell/cabal/pull/7997)
43   - Script support improved or added across relevant commands.
44   - `cabal run script` will now cache results and will not do a fresh build every time.
45   - `cabal build script` added: It will build the cache for script.
46   - `cabal repl script` added: It will open a repl for script using the cache if available.
47   - `cabal clean script` added: It will clean the cache for script.
48   - `cabal clean` will now remove script caches for which there is no marching script.
49   - `cabal list-bin` now works with scripts
50   - The name of the generated script executable has been changed from "script" to
51     "cabal-script-<your-sanitized-script-name>" for easier process management.
52   - Reduce the default verbosity of scripts, so that the build output doesn't interfere with the script output.
53   - Scripts now support a project metadata block that allows them to use options
54     that would normally be set in a cabal.project file.
56 - `cabal-install-solver`: Backtrack when no pkg-config is present [#7448](https://github.com/haskell/cabal/issues/7448) [#7621](https://github.com/haskell/cabal/pull/7621)
58   When solving for pkgconfig-depends, when pkg-config is not present, the cabal solver will now backtrack and try a different automatic flag and dependency configuration, just as it does if pkg-config is present, but does not contain the specified package.
60 - Apply local options only to local packages [#7998](https://github.com/haskell/cabal/issues/7998) [#7973](https://github.com/haskell/cabal/pull/7973)
62   - Command-line `ghc-options` only applies to local packages
63   - `program-options` stanza only applies to local packages
65 - Add `--open` flag to `cabal haddock` [#7366](https://github.com/haskell/cabal/issues/7366) [#7550](https://github.com/haskell/cabal/pull/7550)
68 ### Other changes
70 - Remove `world` file functionality [#6767](https://github.com/haskell/cabal/issues/6767) [#7746](https://github.com/haskell/cabal/pull/7746)
72   In `v1-install`, `world` was used to trace what packages have been
73   installed, and re-install everything that is listed in it on-demand. However, in
74   `v2-install`, this is no longer needed, and outdated.
75   Additionally, `world` code-path is probably not up-to-date, remove it instead of
76   having partial features.
78   - Don't generate `world` file in `~/.cabal` when `v1-install` is executed.
80   - Don't ever read `world` from `~/.cabal`.
82   - Remove meta-target `world` from `v1-install`.
84 - A default configuration is no longer written when a config file is given explicitly [#7705](https://github.com/haskell/cabal/issues/7705) [#7715](https://github.com/haskell/cabal/pull/7715)
86   - When no config file exists, `cabal` commands will create a default one.
88   - This behavior is discontinued now when the config file is given explicitly
89     via the `--config-file` option or the `CABAL_CONFIG` environment variable.
91   - If no config file is given explicitly, and the default config file
92     (relative to `CABAL_DIR`) does not exist, it is created as it used to be.
94 - Use `nroff -man | less` instead of `man` as backend for `cabal man` [#7714](https://github.com/haskell/cabal/issues/7714) [#7726](https://github.com/haskell/cabal/pull/7726)
96   The previous implementation of `cabal man` used `man` as backend to
97   view the generated manpage file.  However, macOS' and BSD's `man` does
98   not accept a file as input, so `cabal man` was broken on macOS and
99   BSD.
101   The issue has been fixed by piping the generated manpage through
102   `nroff -man` and then into `$PAGER` which defaults to `less`.  Thus,
103   `cabal man` now works both on Linux and macOS/BSD.
105   NB: `cabal man` requires `nroff` to be installed which is the case for
106   standard setups (but may not be case on slim setups like VMs used in
107   CI).  Note that `nroff` is not necessarily a prerequisite of a package
108   containing `man`.
110 - Use `Win32 >= 2.8` to get `Win32.sYNCHRONIZE` [#7835](https://github.com/haskell/cabal/issues/7835) [#7982](https://github.com/haskell/cabal/pull/7982)
112   #7982 also completes a changelog entry for `Cabal-3.6.1.0`, noting it is required for `cabal-install >= 3.6`.
114 - Add `preferred-versions` support for `LocalIndexRepo` [#7294](https://github.com/haskell/cabal/issues/7294) [#7295](https://github.com/haskell/cabal/pull/7295)
116   - Previously, the only repo-index-type that reads the preferred-versions file was `RepoRemote`.
117     `LocalIndexRepo` now also supports parsing `preferred-versions` file, main purpose is to write tests.
118     As a nice side-effect, users can provide their own overlay over package sets to restrict or prefer certain package versions.
120 - Add `preferred-versions` support for `cabal outdated` [#5603](https://github.com/haskell/cabal/issues/5603) [#7249](https://github.com/haskell/cabal/issues/7249) [#7296](https://github.com/haskell/cabal/pull/7296)
122   - `cabal outdated` honours the `preferred-versions` file which might deprecate or prefer certain
123     versions of packages. In particular, if the only newer version of a package has been deprecated,
124     `cabal outdated` should not report that there are newer versions available.
126 - Standalone tests for `cabal init` [#7410](https://github.com/haskell/cabal/issues/7410) [#7424](https://github.com/haskell/cabal/pull/7424)
128   - change the behaviour of the `--tests` flag for `cabal init`,
129     see https://github.com/haskell/cabal/issues/7410#issuecomment-849913926
130   - add a new value `TestSuite` for the `PackageType` type
132 - `cabal outdated --v2-freeze-file` prints error message if no freeze file can be found [#7406](https://github.com/haskell/cabal/issues/7406) [#7440](https://github.com/haskell/cabal/pull/7440)
134   Instead of ignoring a missing `.freeze` file, abort execution and print an error message.
136 - Make `cabal` respect `setgid` permission bit when creating directories [#7560](https://github.com/haskell/cabal/issues/7560) [#7572](https://github.com/haskell/cabal/pull/7572)
138   - Previously `cabal` would override an admin's choice to use setgid on the
139     `.cabal` directory by using hardcoded file and directory modes upon
140     creation. Instead we now take what the system decides and only add to
141     that set of permissions.
143 - Glob expand `extra-source-files` when tracking for rebuild [#4746](https://github.com/haskell/cabal/issues/4746) [#7608](https://github.com/haskell/cabal/pull/7608)
145   - Since 3.4, `extra-source-files` have been tracked by cabal-install in the rebuild-checking logic. However, this tracking did not, until this PR, take into account glob-expansion.
147 - Improve error message when no test/benchmark is found [#5079](https://github.com/haskell/cabal/issues/5079) [#5255](https://github.com/haskell/cabal/issues/5255) [#7834](https://github.com/haskell/cabal/pull/7834)
149   When `cabal test` and the error message recommends setting `tests: True`, the next `cabal test` run is likely to fail with a solver error. The user might incorrectly conclude that setting `tests: True` made the problem worse, because the failure now occurs earlier (at solving time rather than at testing time).
151   By including the fact that a plan failure is expected in the error message, hopefully users will be more confident that setting `tests: True` was the right move, so they will be able to focus on the true cause of the problem: the fact that no plan including the tests exists.
153 - Remove `Distribution.Client.Compat.FilePerms` [#7948](https://github.com/haskell/cabal/pull/7948)
155   - Remove the module `Distribution.Client.Compat.FilePerms`, since it's
156     both dead code and duplicates code from `Distribution.Compat.CopyFile`.
158 - Avoid malformed range requests [#5952](https://github.com/haskell/cabal/issues/5952) [#7970](https://github.com/haskell/cabal/pull/7970)
160   - Don't send malformed range requests. Should make fetching from head.hackage and other "unstable" overlays more reliable.
162 - Improve error message for empty `--allow-newer=`  [#7740](https://github.com/haskell/cabal/issues/7740) [#8140](https://github.com/haskell/cabal/pull/8140)
164   Instead of internal error, the message now explains that empty argument for
165   `--allow-newer=` is not allowed and reminds what `--allow-newer` (with the empty
166   argument) means.
168 - `cabal check` now fails when no upper bounds for `base` or `Cabal` are present in setup dependencies [#4683](https://github.com/haskell/cabal/issues/4683) [#5370](https://github.com/haskell/cabal/pull/5370) [#7409](https://github.com/haskell/cabal/pull/7409)
170 - Fix `v2-haddock` results in "unexpected status" [#6679](https://github.com/haskell/cabal/issues/6679) [#7843](https://github.com/haskell/cabal/pull/7843)
172 - Fix that cabal v2 commands (`install`, `repl`, `run`) use duplicate global config and rebuild libs twice in the store [#6907](https://github.com/haskell/cabal/issues/6907) [#7753](https://github.com/haskell/cabal/pull/7753) [#7759](https://github.com/haskell/cabal/pull/7759)
174 - `--repl-no-load` option skips startup modules load in REPL [#7541](https://github.com/haskell/cabal/issues/7541) [#7578](https://github.com/haskell/cabal/pull/7578)
176 - Fix post-checkout-command crash when 0 exit status bug [#7641](https://github.com/haskell/cabal/issues/7641) [#7847](https://github.com/haskell/cabal/pull/7847)
178 - Fix `list-bin` to only choose the selected component [#7679](https://github.com/haskell/cabal/issues/7679) [#7791](https://github.com/haskell/cabal/pull/7791)
180 - `cabal sdist` works in projects with `extra-packages` [#7698](https://github.com/haskell/cabal/issues/7698)
182 - Add `-c` alias for `--constraint` command line flag [#7765](https://github.com/haskell/cabal/issues/7765) [#7766](https://github.com/haskell/cabal/pull/7766)
184 - Ensure that `v2-sdist` command respects the `--ignore-project` flag [#7965](https://github.com/haskell/cabal/issues/7965) [#8109](https://github.com/haskell/cabal/pull/8109)
186 - Make enable/disable nix flags easier to read [#8036](https://github.com/haskell/cabal/issues/8036) [#8054](https://github.com/haskell/cabal/pull/8054)
188 - Add "prompt" strategy when symlinking binaries. [#5672](https://github.com/haskell/cabal/pull/5672)
190 - Add a verbosity flag `+nowarn`, to suppress all warnings [#7286](https://github.com/haskell/cabal/issues/7286) [#7470](https://github.com/haskell/cabal/pull/7470)
192 - Lazily decode cache files for checking invalidation [#7466](https://github.com/haskell/cabal/issues/7466) [#7516](https://github.com/haskell/cabal/pull/7516)
194 - Defer `build-tools-depends` choices as well as setup choices [#7532](https://github.com/haskell/cabal/pull/7532) [#7561](https://github.com/haskell/cabal/pull/7561)
196 - Fix running GHCJS executables [#6175](https://github.com/haskell/cabal/issues/6175) [#6361](https://github.com/haskell/cabal/issues/6361) [#7575](https://github.com/haskell/cabal/pull/7575)
198 - Support Git submodules in `source-package-repository` [#5536](https://github.com/haskell/cabal/issues/5536) [#7625](https://github.com/haskell/cabal/pull/7625)
200 - Add support for `--package-db` flags to v2 commands [#5773](https://github.com/haskell/cabal/issues/5773) [#7676](https://github.com/haskell/cabal/pull/7676)
202 - `cabal init` now takes an optional argument and treats it as root directory for the new package [#7871](https://github.com/haskell/cabal/issues/7871) [#7873](https://github.com/haskell/cabal/pull/7873)
204 - Silence warning about `world`-file field being unrecognised for flat config files [#7894](https://github.com/haskell/cabal/issues/7894) [#7903](https://github.com/haskell/cabal/pull/7903)
206 - Fix Ctrl-C handling during package download [#6322](https://github.com/haskell/cabal/issues/6322) [#7929](https://github.com/haskell/cabal/pull/7929)
208 - Fix the timestamp shown during `cabal update` [#7934](https://github.com/haskell/cabal/pull/7934)
210 - Sync darcs repos [#7137](https://github.com/haskell/cabal/pull/7137)
212 - `cabal-install-solver`: Provide more context in error messages [#7468](https://github.com/haskell/cabal/issues/7468) [#7473](https://github.com/haskell/cabal/pull/7473)
214   - Error messages for misspelled extensions and languages now provide additional context.
215   - The error messages will provide a suggested fix if the misspelled extension or language is similar enough
216     to known languages and extensions.
218 - cabal init -i should autodetect author name and maintainer email (fix #8255) [#8255](https://github.com/haskell/cabal/issues/8255) [#8267](https://github.com/haskell/cabal/pull/8267)
220 - cabal init -i: add the GHC2021 language option [#8265](https://github.com/haskell/cabal/issues/8265) [#8277](https://github.com/haskell/cabal/pull/8277)
222 - Automatically pipe auth from repo uris into curl transport. [#4743](https://github.com/haskell/cabal/issues/4743) [#7630](https://github.com/haskell/cabal/pull/7630)
224 - Build release archives (and validate) with GHC 9.2.3 [#8271](https://github.com/haskell/cabal/issues/8271) [#8272](https://github.com/haskell/cabal/pull/8272)
225   - The release binaries are now built with GHC 9.2.3, which fixes some minor snags
227 ### Internal changes
229 - Remove bootstrapping plan files from version control, and simplify bootstrap update `Makefile` targets. [#7949](https://github.com/haskell/cabal/pull/7949)
231 - CI setup
233   - Remove Travis scripts [#6959](https://github.com/haskell/cabal/pull/6959)