Haddock: use buildSettingKeepTempFiles
[cabal.git] / release-notes / cabal-install-3.10.1.0.md
blob88cae108891de6b83226391a2f2d0f25267885a8
1 cabal-install and cabal-install-solver 3.10.1.0 changelog and release notes
2 ---
4 Release 3.10.1.0 of cabal now sets the `--enable-documentation` option by default
5 when running `cabal haddock` (https://github.com/haskell/cabal/issues/7462).
6 If the new default does not fit your workflow, pass an explicit `--disable-documentation`
7 option or consider (helping to implement) the other workarounds proposed
8 in https://github.com/haskell/cabal/issues/8725.
10 This version of cabal introduces support for JS cross-compilation (https://github.com/haskell/cabal/pull/8636).
11 We've seen related Windows segfaults on CI, so please kindly report if you can reproduce either
12 cabal or GHC segfaults when cross-compiling for JS or compiling normally but with any files
13 listed in the `js-sources` field of a .cabal file.
15 This release of cabal also fixes a lot of bugs in cabal 3.8.1.0 and not all of the fixes
16 are listed here.
19 ### Significant changes
21 - `Cabal-3.10.1.0` is used, which brings [its own set of changes](./Cabal-3.10.1.0.md),
22   many of which are significant. The Cabal and Cabal-syntax changes that touch
23   the cabal-install or cabal-install-solver codebases are pasted here again in full.
25 - Add support for the XDG Base Directory Specification [#680](https://github.com/haskell/cabal/issues/680) [#7386](https://github.com/haskell/cabal/pull/7386)
27   Cabal/cabal-install now uses the XDG Base Directory Specification to
28   store configuration, caches, and the store.  Specifically,
29   `$XDG_CONFIG_HOME/cabal` stores the configuration file,
30   `$XDG_CACHE_HOME/cabal` stores downloaded packages and similar, and
31   `$XDG_STATE_HOME/cabal` mainly contains the store of compiled
32   packages.  Further, `cabal install` will put executables in
33   `~/.local/bin` by default.
35   The `dist`/`dist-newstyle` directories are not affected.
37   On Windows, these XDG paths are mapped to other (hopefully)
38   appropriate locations.  See the Cabal User Guide for information.
40   If the `CABAL_DIR` environment variable is set, the indicated
41   directory will be used to store all Cabal-related files, as in
42   previous versions.
44   **Backwards compatibility**: If `~/.cabal` already exists, this will be
45   interpreted as `CABAL_DIR=~/.cabal`.  This means that upgrading on an
46   existing system already using cabal-install should not cause any
47   change in behaviour.  An existing system can be migrated by deleting
48   `~/.cabal` (possibly copying `~/.cabal/config` to
49   `~/.config/cabal/config` first).
51 - Add `installDirs` (`datadir`, etc) to v2-build and remove them from v2-install [#8556](https://github.com/haskell/cabal/pull/8556)
53   - Passes through `--prefix`, `--datadir` and other `installdir`-arguments properly in v2-build, allowing its use in preparing somewhat more relocatable compilation targets (no worse than v1-build).
54   - Removes these flags (which never worked) from v2-install
56 - No global packages auto written to environment files, allow `--force-reinstalls` [#5559](https://github.com/haskell/cabal/issues/5559) [#6165](https://github.com/haskell/cabal/issues/6165) [#8607](https://github.com/haskell/cabal/pull/8607)
58   - When v2-install runs on a library, it does not pin global packages in the env file, only those directly necessary for the library.
60 - Add support for GHC 9.4+ `-fprof-late` flag [#8528](https://github.com/haskell/cabal/pull/8528)
62   - This adds the new `late-toplevel` (and its alias `late`) profiling-detail option which enables `-fprof-late`-based automatic cost centre annotations for GHCs that support it ([earliest is GHC 9.4.1](https://downloads.haskell.org/ghc/9.4.1/docs/users_guide/profiling.html#ghc-flag--fprof-late)).
64 - Added `haddock-project` command [#7669](https://github.com/haskell/cabal/issues/7669) [#8162](https://github.com/haskell/cabal/pull/8162)
66   The `haddock-project` command can be used to build documentation of multiple
67   packages.  By passing `--local` option the directory will be self contained,
68   by passing `--hackage` links to dependencies will link to `hackage`.  Both
69   `--local` and `--hackage` options imply `--quickfix`, `--gen-index`,
70   `--gen-contents`, and `--hyperlinked-source`.
72   Building self contained directory is the default, unless `--hackage` or
73   `--html-location`.
75   The PR #8162 also fixes the `--with-haddock` option.
78 ### Other changes
80 - Pretty-print run targets on failure [#8189](https://github.com/haskell/cabal/issues/8189) [#8234](https://github.com/haskell/cabal/pull/8234)
82   - Targets of the `run` command are pretty-printed when failing due to multiple targets.
83   - Duplicate targets are removed in the output.
85 - Expose `BuildFlags` and `ClientHaddockFlags` [#8351](https://github.com/haskell/cabal/issues/8351) [#8353](https://github.com/haskell/cabal/pull/8353)
87   Some types are present in public functions in cabal-install, but they are not exported.
88   This PR fix it for BuildFlags and ClientHaddockFlags.
90 - `cabal man` handles `$PAGER` containing arguments now [#8405](https://github.com/haskell/cabal/issues/8405) [#8353](https://github.com/haskell/cabal/pull/8353)
92   Things like `PAGER="less -FX" cabal man` work now.
94   There's a slight change in the default behavior. We still use `less -R` as the default,
95   but if the user passes `PAGER=less`, we won't add -R to that, unlike before. This is
96   reasonable, as the user should be able to set the variable as they see fit.
98 - Fix issue with "nix" config option [#8452](https://github.com/haskell/cabal/issues/8452) [#8522](https://github.com/haskell/cabal/pull/8522)
100   Nix option in config file was broken with [#8054](https://github.com/haskell/cabal/pull/8054), this should fix it.
102 - "Build profile" message now reflects optimization level set in global config [#8487](https://github.com/haskell/cabal/issues/8487) [#8488](https://github.com/haskell/cabal/pull/8488)
104   Imagine you have `optimization: 2` in your `~/.cabal/config`, and you call `cabal build`
105   in a project that doesn't have optimization level explicitly set in its project file.
106   You will still see 'Build profile: -w ghc-<VER> -O1'. This is incorrect and was fixed
107   in this patch: now you'll see '-O2'.
109 - `ghc`, `ghc-boot`, `ghci` packages should be non-upgradable [#8489](https://github.com/haskell/cabal/issues/8489) [#8501](https://github.com/haskell/cabal/pull/8501)
111   - Changed both `Distribution.Client.Dependency`'s `dontUpgradeNonUpgradeablePackages`
112     and `Distribution.Solver.Modular.Solver`'s `nonInstallable` to be in sync.
114 - Apply command line flags to install packages [#8637](https://github.com/haskell/cabal/issues/8637) [#8779](https://github.com/haskell/cabal/pull/8779)
116   - Command line flags usually only apply to "local" packages (packages specified
117     in the cabal.project). This change causes the v2-install command to ignore
118     that distinction to better match the expected behavior for packages specified
119     directly in the command.
121 - Print a warning when assertions are enabled [#4377](https://github.com/haskell/cabal/issues/4377) [#8240](https://github.com/haskell/cabal/pull/8240)
123   - Now cabal-install executable will print a warning if assertions are enabled
125 - Implement `--prefer-oldest` [#8261](https://github.com/haskell/cabal/pull/8261)
127   - The new flag makes Cabal solver try to find a build plan with the oldest versions possible. This is useful to establish lower bounds.
129 - Update and sdist now only check for compiler when project file has conditionals [#8352](https://github.com/haskell/cabal/issues/8352) [#8550](https://github.com/haskell/cabal/issues/8550) [#8589](https://github.com/haskell/cabal/issues/8589) [#8358](https://github.com/haskell/cabal/pull/8358) [#8627](https://github.com/haskell/cabal/pull/8627)
131   - Cabal update and sdist will not require a ghc in path unless the project has conditionals that require it
133 - Allow offline bootstrapping of cabal-install [#8368](https://github.com/haskell/cabal/pull/8368)
135   - The bootstrap script for cabal-install now supports fetching the sources of the dependencies in a separate step.
136     One can then copy over the resulting archive and perform offline bootstrapping of cabal-install.
138 - Pass some haddock flags to dependencies [#395](https://github.com/haskell/cabal/issues/395) [#8104](https://github.com/haskell/cabal/issues/8104) [#8414](https://github.com/haskell/cabal/pull/8414)
140   - Pass `--haddock-hoogle`, `--haddock-html`, `--haddock-internal`, `--haddock-quickjump`, `--haddock-hyperlinked-source`
141     to all the dependencies if they are specified as command line args
143 - build pkgconfig db individually when bulk fails [#8494](https://github.com/haskell/cabal/issues/8494) [#8496](https://github.com/haskell/cabal/pull/8496)
145   - When pkg-config fails to get versions for all packages in bulk, falls back to querying one-by-one.
147 - improve install target handling logic regarding of project files [#8094](https://github.com/haskell/cabal/issues/8094) [#8352](https://github.com/haskell/cabal/issues/8352) [#8498](https://github.com/haskell/cabal/pull/8498)
149   - fixes an issue where `cabal install pkg-x.y.z` fails unless `--ignore-project` is given
150   - fixes an issue where `cabal install --ignore-project` crashes when a project file is present
152 - Redownload packages when source hash verification fails [#7541](https://github.com/haskell/cabal/issues/7541) [#8500](https://github.com/haskell/cabal/pull/8500)
154   - Cabal-install will verify source hashes on cached downloads against the current index, and redownload on mismatch. (Which can occur with e.g. head.hackage)
156 - `cabal init -i` should sanitize package name guessed from the directory name [#8404](https://github.com/haskell/cabal/issues/8404) [#8561](https://github.com/haskell/cabal/pull/8561)
158   If the current directory name has any non-alphanumeric symbols in its name, the symbols will be replaced with a dash. Also, will make sure that the resulting package name starts with a letter.
160   This worked for cabal init -n already, and this PR only moves code around so that cabal init -i also benefits from this logic.
162 - Support `js-sources` with GHC, not only with GHCJS [#8636](https://github.com/haskell/cabal/pull/8636)
164   - Take into account `js-sources` when building library components with GHC
165   - Missing support for `js-sources` in executable components is tracked in #8639
167 - Fix `extra-source-file` rebuild tracking when run in a multi-package project [#8632](https://github.com/haskell/cabal/issues/8632) [#8634](https://github.com/haskell/cabal/issues/8634) [#8640](https://github.com/haskell/cabal/pull/8640)
169   - Fixes an issue where glob expansion of `extra-source-files` for rebuild tracking purposes was not occurring correctly when run in a multi-package setting (i.e. when the globs needed to be expanded relative to something other than ".").
171 - No up-front warning that assertions are on for special commands (help, version, numeric-version) [#8645](https://github.com/haskell/cabal/issues/8645) [#8647](https://github.com/haskell/cabal/pull/8647)
173   - When compiled with ghc option `-fno-ignore-assert`, `cabal-install` will issue a generic warning that assertions are on.
174     This warning will no longer be emitted for special modes of operation like `cabal --numeric-version`, `--version` and help,
175     and also not if `cabal` could not parse its command line.
176     Further, the warning now goes to `stderr` rather than `stdout`.
178 - Fix and improve list parser for `cabal init` arguments [#8659](https://github.com/haskell/cabal/issues/8659) [#8663](https://github.com/haskell/cabal/pull/8663)
180   Occurrences of 'Flag [a]' seem to behave in an unexpected way. The monoid
181   instance of 'Flag' is right associative and discard the value on the
182   left, but we want to merge the contents of 'Flag'.
184   Permits:
185   - `cabal init -d base -d vector -d containers`
187   Fixes for all Flag '[a]' the cli parser in cabal init. Adds cli parser tests.
189   Adds the feature to specify a comma-separated list of dependencies:
190   - `cabal init -d base,vector,containers`
192 - Fix resolution of imports by relative paths in cabal.project [#8686](https://github.com/haskell/cabal/pull/8686)
194   Fix bug where cabal tries to resolve imports by relative paths against
195   the directory cabal executable was invoked in rather than directory of
196   cabal.project file that does the import.
198 - Fix `cabal repl` discarding `--build-depends` [#6859](https://github.com/haskell/cabal/issues/6859) [#7081](https://github.com/haskell/cabal/issues/7081) [#8732](https://github.com/haskell/cabal/pull/8732)
200   - Fix `repl` command discarding `--build-depends` argument when using
201     `allow-newer` or `allow-older`.
203 - Add `cabal get --only-package-description` [#1954](https://github.com/haskell/cabal/issues/1954) [#1977](https://github.com/haskell/cabal/pull/1977) [#5162](https://github.com/haskell/cabal/pull/5162) [#8263](https://github.com/haskell/cabal/pull/8263)
205 - `cabal haddock` now implies `--enable-documentation` [#7462](https://github.com/haskell/cabal/issues/7462) [#8259](https://github.com/haskell/cabal/pull/8259)
207 - Include `extra-lib-dirs-static` into `PackageHash` [#6935](https://github.com/haskell/cabal/issues/6935) [#7794](https://github.com/haskell/cabal/pull/7794)
209 - Document `cabal check` in the user guide [#8237](https://github.com/haskell/cabal/pull/8237)
211 - Add documentation (or stubs) for cabal-install commands: `fetch`, `get`, `info`, `init`, `list`, `report`, `unpack`, `upload`, `user-config` [#7884](https://github.com/haskell/cabal/issues/7884) [#7978](https://github.com/haskell/cabal/issues/7978) [#8308](https://github.com/haskell/cabal/issues/8308) [#8309](https://github.com/haskell/cabal/pull/8309)
213 - Add check for upper bound on any dependency in `cabal check` [#8291](https://github.com/haskell/cabal/issues/8291) [#8339](https://github.com/haskell/cabal/pull/8339)