diff --git a/Cabal-hooks/CHANGELOG.md b/Cabal-hooks/CHANGELOG.md index 46a825897db..b25fd04e988 100644 --- a/Cabal-hooks/CHANGELOG.md +++ b/Cabal-hooks/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog for `Cabal-hooks` +## 3.16.0 – July 2025 + * No changes + ## 3.14.2 – April 2025 * No changes diff --git a/Cabal-syntax/ChangeLog.md b/Cabal-syntax/ChangeLog.md index 15eaf05e88b..b00ea056e81 100644 --- a/Cabal-syntax/ChangeLog.md +++ b/Cabal-syntax/ChangeLog.md @@ -1 +1 @@ -Please see https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.14.2.0.md +Please see https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.16.0.0.md diff --git a/Cabal/ChangeLog.md b/Cabal/ChangeLog.md index 184d64fa338..11394be5189 100644 --- a/Cabal/ChangeLog.md +++ b/Cabal/ChangeLog.md @@ -1,3 +1,6 @@ +# 3.16.0.0 [Artem Pelenitsyn](mailto:a@pelenitsyn.top) July 2025 +* See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.16.0.0.md + # 3.14.2.0 [Mikolaj Konarski](mailto:mikolaj@well-typed.com) April 2025 * See https://github.com/haskell/cabal/blob/master/release-notes/Cabal-3.14.2.0.md diff --git a/cabal-install-solver/ChangeLog.md b/cabal-install-solver/ChangeLog.md index e98218e072c..0f5cea55530 100644 --- a/cabal-install-solver/ChangeLog.md +++ b/cabal-install-solver/ChangeLog.md @@ -1 +1 @@ -Please see https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.14.2.0.md +Please see https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.16.0.0.md diff --git a/cabal-install/ChangeLog.md b/cabal-install/ChangeLog.md index a6b878a5298..f4e9babf7cd 100644 --- a/cabal-install/ChangeLog.md +++ b/cabal-install/ChangeLog.md @@ -1,5 +1,9 @@ # Change-log +## 3.16.0.0 [Artem Pelenitsyn](mailto:a@pelenitsyn.top) July 2025 + +* See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.16.0.0.md + ## 3.14.2.0 [Mikolaj Konarski](mailto:mikolaj@well-typed.com) April 2025 * See https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.14.2.0.md diff --git a/changelog.d/issue-9115.md b/changelog.d/issue-9115.md deleted file mode 100644 index 139f97f8a19..00000000000 --- a/changelog.d/issue-9115.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -synopsis: Add --with-repl flag to specify alternative REPL program -packages: [cabal-install, Cabal] -prs: [10996] -issues: [9115] ---- - -Added a new `--with-repl` command-line option that allows specifying an alternative -program to use when starting a REPL session, instead of the default GHC. - -This is particularly useful for tools like `doctest` and `hie-bios` that need to -intercept the REPL session to perform their own operations. Previously, these tools -had to use `--with-ghc` which required them to proxy all GHC invocations, including -dependency compilation, making the implementation more complex. - -The `--with-repl` option only affects the final REPL invocation, simplifying the -implementation of such wrapper tools. - -Example usage: -```bash -cabal repl --with-repl=doctest -cabal repl --with-repl=/path/to/custom/ghc -``` - -This change also removes the special handling for response files with `--interactive` -mode, as tools are now expected to handle response files appropriately. diff --git a/changelog.d/issue-9694 b/changelog.d/issue-9694 deleted file mode 100644 index ac3fc2b1d88..00000000000 --- a/changelog.d/issue-9694 +++ /dev/null @@ -1,4 +0,0 @@ -synopsis: Don't imply that Haddock docs exist, when warning not installed -packages: Cabal -issues: #9694 -prs: #9695 diff --git a/changelog.d/pr-10190 b/changelog.d/pr-10190 deleted file mode 100644 index d9e4f009b94..00000000000 --- a/changelog.d/pr-10190 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: Fix `cabal clean` permissions on Windows -packages: cabal-install -prs: #10190 -issues: #10182 -significance: - -description: { - -- `cabal clean` now removes the read-only mark recursively in the `dist-newstyle` folder on Windows before attempting to delete it. - -} diff --git a/changelog.d/pr-10254 b/changelog.d/pr-10254 deleted file mode 100644 index b07b66b561f..00000000000 --- a/changelog.d/pr-10254 +++ /dev/null @@ -1,16 +0,0 @@ -synopsis: Shallow and concurrent cloning of git repos -packages: cabal-install -prs: #10254 - -description: { - -- Clone git repositories specified in source-repository-package stanzas - shallowly, since to build the package from the repository we only need to - read the commit specified. The rest of the repo is not needed. - Note that this does not change the behaviour of `cabal get -s`, which will - still clone the repository in full. -- Clone VCS repositories concurrently, with a maximum of two concurrent tasks - at the same time (just like when downloading packages asynchronously) - -} - diff --git a/changelog.d/pr-10273 b/changelog.d/pr-10273 deleted file mode 100644 index 343c871377b..00000000000 --- a/changelog.d/pr-10273 +++ /dev/null @@ -1,19 +0,0 @@ ---- -synopsis: "Show why `cabal act-as-setup configure` failed" -packages: [Cabal] -prs: 10273 ---- - -When `cabal act-as-setup configure` fails, it prints a list of "missing or -private dependencies". - -Now, it will show you if each failing dependency is missing, private, or an -incompatible version: - -``` -Error: [Cabal-8010] -Encountered missing or private dependencies: - Lib:{bar-internal,foo-internal} (missing :bar-internal), - base <=1.0 (installed: 4.18.2.1), - package-that-does-not-exist (missing) -``` diff --git a/changelog.d/pr-10356 b/changelog.d/pr-10356 deleted file mode 100644 index dbe464ae492..00000000000 --- a/changelog.d/pr-10356 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: New licence constructors for SPDX licences starting with a digit -packages: Cabal-syntax -prs: #10356 - -description: { - -- LicenseId constructor `NullBSD` is now `N_0BSD`. -- LicenseId constructor `DS389_exception` is now and `N_389_exception`. -- LicenseId constructor `X3D_Slicer_1_0` is now and `N_3D_Slicer_1_0`. - -} diff --git a/changelog.d/pr-10432 b/changelog.d/pr-10432 deleted file mode 100644 index 1bb76adb0a1..00000000000 --- a/changelog.d/pr-10432 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: Avoid partial `Data.List.last` in autogenerated `Paths_.hs` -packages: Cabal -prs: #10432 -significance: - -description: { - -- Autogenerated `Paths_.hs` now avoids use of the partial function `Data.List.last`. - -} diff --git a/changelog.d/pr-10525 b/changelog.d/pr-10525 deleted file mode 100644 index 7235d0bec74..00000000000 --- a/changelog.d/pr-10525 +++ /dev/null @@ -1,34 +0,0 @@ ---- -synopsis: "A trailing colon after a stanza name in `cabal.project` is now an error" -packages: [cabal-install] -prs: 10525 ---- - -It is now a hard error to use a trailing colon after a stanza name in -`cabal.project` or `*.cabal` files: - -``` -packages: . - -source-repository-package: - type: git - location: https://github.com/haskell/cabal - tag: f34aba976a60940295f41b6649674e9568893894 -``` - -``` -$ cabal build -Error parsing project file cabal.project:3: -'source-repository-package' is a stanza, not a field. Remove the trailing ':' to parse a stanza. -``` - -Previously, the warning message was easily ignored and somewhat misleading, as -the difference between a stanza and a field is not immediately obvious to -Haskellers used to config languages like JSON and YAML (which don't distinguish -between fields which have string or list values and stanzas which have nested -fields): - -``` -Warning: cabal.project: Unrecognized field -'source-repository-package' on line 3 -``` diff --git a/changelog.d/pr-10549 b/changelog.d/pr-10549 deleted file mode 100644 index 257fc103197..00000000000 --- a/changelog.d/pr-10549 +++ /dev/null @@ -1,11 +0,0 @@ -synopsis: Warn on `cabal format` -packages: cabal-install -prs: #10549 -issues: -significance: - -description: { - -- Despite its name, `cabal format` is not a proper formatter for cabal files. By chance users have sometimes found the command eventhough it is not mentioned in the help text, and they used it to format cabal files. This has some downsides like comments are stripped away or common stanzas are inlined, the command is more like a dump of the resolved package description. There are future plans (#7544) to make it an actual formatter so, rather than going through a deprecation cycle, we decided to keep this command for future use and in the meantime just warn the user about the fact that it is not a proper formatter. - -} diff --git a/changelog.d/pr-10587 b/changelog.d/pr-10587 deleted file mode 100644 index 92428be048b..00000000000 --- a/changelog.d/pr-10587 +++ /dev/null @@ -1,12 +0,0 @@ ---- -synopsis: "Quieter Git output" -packages: [cabal-install] -prs: 10587 ---- - -When `cabal` clones a Git repo for a `source-repository-package` listed in a -`cabal.project`, it will run various commands to check out the correct -revision, initialize submodules if they're present, and so on. - -Now, `cabal` will pass `--quiet` to Git in more cases to help prevent -cluttering command-line output. diff --git a/changelog.d/pr-10590 b/changelog.d/pr-10590 deleted file mode 100644 index 5121bbfb959..00000000000 --- a/changelog.d/pr-10590 +++ /dev/null @@ -1,14 +0,0 @@ ---- -synopsis: "Don't run submodule commands unless necessary" -packages: [cabal-install] -prs: 10590 ---- - -When `cabal` clones a Git repo for a `source-repository-package` listed in a -`cabal.project`, it will run various commands to check out the correct -revision, initialize submodules if they're present, and so on. - -Now, `cabal` will avoid running `git submodule` commands unless the cloned -repository contains a `.gitmodules` file. This will declutter `cabal`'s debug -output by running fewer commands. - diff --git a/changelog.d/pr-10629 b/changelog.d/pr-10629 deleted file mode 100644 index 2d8259b45ef..00000000000 --- a/changelog.d/pr-10629 +++ /dev/null @@ -1,13 +0,0 @@ ---- -synopsis: "Report trailing spaces in project import URIs" -packages: [cabal-install, cabal-install-solver] -prs: 10629 -issues: 10622 ---- - -> A string is a valid URL potentially surrounded by spaces if, after stripping -> leading and trailing whitespace from it, it is a valid URL." -> SOURCE: [W3C/HTML5/URLs](https://www.w3.org/TR/2010/WD-html5-20100624/urls.html) - -Fixes a problem of mistaking a URI for a file path when it has trailing spaces -and warn about such trailing spaces. diff --git a/changelog.d/pr-10637 b/changelog.d/pr-10637 deleted file mode 100644 index 0cff281a4d0..00000000000 --- a/changelog.d/pr-10637 +++ /dev/null @@ -1,11 +0,0 @@ ---- -synopsis: Fix Haddock CSS handling in multi-package projects -packages: [cabal-install, Cabal] -prs: 10637 -issues: [10636] ---- - -When `--css=` flag is provided to `cabal haddock-project`: - -- the Haddock index is now properly styled by the provided CSS file -- each package in the project now has their docs properly styled by the provided CSS file diff --git a/changelog.d/pr-10644.md b/changelog.d/pr-10644.md deleted file mode 100644 index f6e31264567..00000000000 --- a/changelog.d/pr-10644.md +++ /dev/null @@ -1,165 +0,0 @@ ---- -synopsis: Show source of project parse error or warning -packages: [cabal-install] -prs: 10644 -issues: 10635 ---- - -Improves warning and error messages shown when parsing project files and their -imports. - -## Warning Messages - -To trigger these warning messages, the examples use badly formed comments that -have a single dash instead of two as is required of a line comment in `.cabal` -and `.project` files (and imported `.config` files). - - -* Before the fix: - - The `cabal.project` file name is repeated. Warnings are misattributed to - having been in the project rather than from a configuration file imported by - the project. Warnings are shown in reverse line number order. - - ``` - $ ~/.ghcup/bin/cabal-3.12.1.0 build all --dry-run - ... - Warning: - /.../ParseWarningProvenance/cabal.project, - cabal.project, cabal.project, cabal.project, cabal.project: Unrecognized - section '-' on line 123 - /.../ParseWarningProvenance/cabal.project, - cabal.project, cabal.project, cabal.project, cabal.project: Unrecognized - section '-' on line 3 - /.../ParseWarningProvenance/cabal.project, - cabal.project, cabal.project, cabal.project, cabal.project: Unrecognized - section '-' on line 2 - /.../ParseWarningProvenance/cabal.project, - cabal.project, cabal.project, cabal.project, cabal.project: Unrecognized - section '-' on line 1 - /.../ParseWarningProvenance/cabal.project, - cabal.project, cabal.project, cabal.project, cabal.project: Unrecognized - section '-' on line 123 - /.../ParseWarningProvenance/cabal.project, - cabal.project, cabal.project, cabal.project, cabal.project: Unrecognized - section '-' on line 3 - /.../ParseWarningProvenance/cabal.project, - cabal.project, cabal.project, cabal.project, cabal.project: Unrecognized - section '-' on line 2 - /.../ParseWarningProvenance/cabal.project, - cabal.project, cabal.project, cabal.project, cabal.project: Unrecognized - section '-' on line 1 - ``` - -* After the fix: - - The warnings are shown in a list. For warnings within the same `.project` or - imported `.config` file, warnings are sorted by line number. The file that - is the source of the warning is shown. - - The warnings associated with configuration files are shown in the order - these files were imported by the project: - - ``` - $ cat cabal.project - packages: no-pkg-dir - import: dir-x/a.config - import: dir-y/a.config - import: x.config - import: y.config - ``` - - ``` - $ cabal build all --dry-run - ... - Warnings found while parsing the project file, cabal.project: - - dir-x/a.config: Unrecognized section '-' on line 1 - - dir-x/a.config: Unrecognized section '-' on line 2 - - dir-x/a.config: Unrecognized section '-' on line 3 - - dir-y/a.config: Unrecognized section '-' on line 123 - - x.config: Unrecognized section '-' on line 1 - - x.config: Unrecognized section '-' on line 2 - - x.config: Unrecognized section '-' on line 3 - - y.config: Unrecognized section '-' on line 123 - ``` - -## Error Messages from Project - -To trigger these error messages, the examples use badly formed conditions: - -``` -$ cat cabal.project --- The following failing condition is not on the first line so we can check the --- line number: -if _ -``` - -* Before the fix: - - The parse error is shown with hard line breaks. - - ``` - $ ~/.ghcup/bin/cabal-3.12.1.0 build all --dry-run - ... - Error: [Cabal-7090] - Error parsing project file /.../ParseErrorProvenance/cabal.project:3: - "" (line 1, column 1): - unexpected SecArgName (Position 1 4) "_" - ``` - -* After the fix: - - The snippet that failed to parse may be shown and the parse error is shown - as one line, with no hard line breaks. - - ``` - $ cabal build all --dry-run - ... - Error: [Cabal-7090] - Error parsing project file cabal.project:3: - - Failed to parse 'if(_)' with error: - "" (line 1, column 1): unexpected SecArgName (Position 1 4) "_" - ``` - -## Error Messages from Imported Config - -With the same setup but now with the error in an imported file: - -``` -$ cat elif.project -import: dir-elif/elif.config - -$ cat dir-elif/elif.config --- The following failing condition is not on the first line so we can check the --- line number: -if false -elif _ -``` - -* Before the fix: - - The project rather than the imported configuration file is shown as the source file. - - ``` - $ ~/.ghcup/bin/cabal-3.12.1.0 build all --dry-run - ... - Error: [Cabal-7090] - Error parsing project file /.../ParseErrorProvenance/elif.project:4: - "" (line 1, column 1): - unexpected SecArgName (Position 1 6) "_" - ``` - -* After the fix: - - The imported configuration file is shown as the source with a snippet of the error. - - ``` - $ cabal build all --dry-run - ... - Error: [Cabal-7090] - Error parsing project file dir-elif/elif.config:4: - - dir-elif/elif.config - imported by: elif.project - - Failed to parse 'elif(_)' with error: - "" (line 1, column 1): unexpected SecArgName (Position 1 6) "_" - ``` diff --git a/changelog.d/pr-10646.md b/changelog.d/pr-10646.md deleted file mode 100644 index fb7dd8c9ec7..00000000000 --- a/changelog.d/pr-10646.md +++ /dev/null @@ -1,209 +0,0 @@ ---- -synopsis: Configuration messages without duplicates -packages: [cabal-install-solver] -prs: 10646 -issues: 10645 ---- - -The "using configuration from" message no longer has duplicates on Windows when -a `cabal.project` uses forward slashes for its imports but the message reports -the same import again with backslashes. - -```diff -$ cat cabal.project -import: dir-a/b.config - -$ cabal build all --dry-run -... -When using configuration from: -- - dir-a/b.config - - dir-a\b.config - - cabal.project -``` - -## Changed `Ord ProjectConfigPath` Instance - -For comparison purposes, path separators are normalized to the `buildOS` -platform's path separator. - -```haskell --- >>> let abFwd = ProjectConfigPath $ "a/b.config" :| [] --- >>> let abBwd = ProjectConfigPath $ "a\\b.config" :| [] --- >>> compare abFwd abBwd --- EQ -``` - -## Changes in `cabal-testsuite` - -### Reading Expected Multiline Strings Verbatim - -With `ghc-9.12.1` adding `-XMultilineStrings`, writing multiline string -expectations for `cabal-testsuite/PackageTests/**/*.test.hs` test scripts might -be have been easier but for a catch. We run these tests with older `GHC` -versions so would need to use `-XCPP` for those versions and the C preprocessor -does not play nicely with string gaps. While it is possible to encode a -multiline string as a single line with embedded LF characters or by breaking the -line up arbitrarily and using `++` concatenation or by calling unlines on a list -of lines, string gaps are the multiline strings of Haskell prior to -`-XMultilineStrings`. - -To avoid these problems and for the convenience of pasting the expected value -verbatim into a file, `readFileVerbatim` can read the expected multiline output -for tests from a text file. This has the same implementation as `readFile` from -the `strict-io` package to avoid problems at cleanup. - -``` -Warning: Windows file locking hack: hit the retry limit 3 while trying to remove -C:\Users\\AppData\Local\Temp\cabal-testsuite-8376 -cabal.test.hs: -C:\Users\\AppData\Local\Temp\cabal-testsuite-8376\errors.expect.txt: removePathForcibly:DeleteFile -"\\\\?\\C:\\Users\\\\AppData\\Local\\Temp\\cabal-testsuite-8376\\errors.expect.txt": -permission denied (The process cannot access the file because it is being used by another process.) -``` - -The other process accessing the file is `C:\WINDOWS\System32\svchost.exe` -running a `QueryDirectory` event and this problem only occurs when the test -fails. - -### Hidden Actual Value Modification - -The `assertOutputContains` function was modifying the actual value (the test -output) with `concatOutput` before checking if it contained the expected value. -This function, now renamed as `lineBreaksToSpaces`, would remove CR values and -convert LF values to spaces. - -```haskell --- | Replace line breaks with spaces, correctly handling @"\\r\\n"@. --- --- >>> lineBreaksToSpaces "foo\nbar\r\nbaz" --- "foo bar baz" --- --- >>> lineBreaksToSpaces "foo\nbar\r\nbaz\n" --- "foo bar baz" --- --- >>> lineBreaksToSpaces "\nfoo\nbar\r\nbaz\n" --- " foo bar baz" -lineBreaksToSpaces :: String -> String -``` - -With this setup, false positives were possible. An expected value using string -gaps and spaces would match a `concatOutput` modified actual value of -"foo_bar_baz", where '_' was any of space, LF or CRLF in the unmodified actual -value. The latter two are false positive matches. - -```haskell -let expect = "foo \ - \bar \ - \baz" -``` - -False negatives were also possible. An expected value set up using string gaps -with LF characters or with `-XMultilineStrings` wouldn't match an actual value -of "foo_bar_baz", where '_' was either LF or CRLF because these characters had -been replaced by spaces in the actual value, modified before the comparison. - -```haskell -let expect = "foo\n\ - \bar\n\ - \baz" -``` - -```haskell -{-# LANGUAGE MultilineStrings #-} - -let expect = """ - foo - bar - baz - """ -``` - -We had these problems: - -1. The actual value was changed before comparison and this change was not visible. -2. The expected value was not changed in the same way as the actual value. This - made it possible for equal values to become unequal (false negatives) and for - unequal values to become equal (false positives). - -### Explicit Changes and Visible Line Delimiters - -To fix these problems, an added `assertOn` function takes a `NeedleHaystack` -configuration for how the search is made, what to expect (to find the expected -value or not) and how to display the expected and actual values. - -A pilcrow ¶ is often used to visibly display line endings but our terminal -output is restricted to ASCII so lines are delimited between `^` and `$` -markers. The needle (the expected output fragment) is shown annotated this way -and the haystack (the actual output) can optionally be shown this way too. - -We can now implement `assertOutputContains` by calling `assertOn`: - -```diff - assertOutputContains :: MonadIO m => WithCallStack (String -> Result -> m ()) -- assertOutputContains needle result = -- withFrozenCallStack $ -- unless (needle `isInfixOf` (concatOutput output)) $ -- assertFailure $ " expected: " ++ needle -- where output = resultOutput result -+ assertOutputContains = assertOn -+ needleHaystack -+ {txHaystack = -+ TxContains -+ { txBwd = delimitLines -+ , txFwd = encodeLf -+ } -+ } -``` - -This is still a lenient match, allowing LF to match CRLF, but `encodeLf` doesn't -replace LF with spaces like `concatOutput` (`lineBreaksToSpaces`) did: - -```haskell --- | Replace line CRLF line breaks with LF line breaks. --- --- >>> encodeLf "foo\nbar\r\nbaz" --- "foo\nbar\nbaz" --- --- >>> encodeLf "foo\nbar\r\nbaz\n" --- "foo\nbar\nbaz\n" --- --- >>> encodeLf "\nfoo\nbar\r\nbaz\n" --- "\nfoo\nbar\nbaz\n" --- --- >>> encodeLf "\n\n\n" --- "\n\n\n" -encodeLf :: String -> String -``` - -If you choose to display the actual value by setting -`NeedleHaystack{displayHaystack = True}` then its lines will be delimited. - -```haskell --- | Mark lines with visible delimiters, @^@ at the start and @$@ at the end. --- --- >>> delimitLines "" --- "^$" --- --- >>> delimitLines "\n" --- "^$\n" --- --- >>> delimitLines "\n\n" --- "^$\n^$\n" --- --- >>> delimitLines "\n\n\n" --- "^$\n^$\n^$\n" --- --- >>> delimitLines $ encodeLf "foo\nbar\r\nbaz" --- "^foo$\n^bar$\n^baz$" --- --- >>> delimitLines $ encodeLf "foo\nbar\r\nbaz\n" --- "^foo$\n^bar$\n^baz$\n" --- --- >>> delimitLines $ encodeLf "\nfoo\nbar\r\nbaz\n" --- "^$\n^foo$\n^bar$\n^baz$\n" -delimitLines:: String -> String -``` - -With `assertOn`, supplying string transformation to both the needle and haystack -before comparison and before display can help find out why an expected value is -or isn't found in the test output. diff --git a/changelog.d/pr-10647 b/changelog.d/pr-10647 deleted file mode 100644 index 4a87939f8b6..00000000000 --- a/changelog.d/pr-10647 +++ /dev/null @@ -1,10 +0,0 @@ ---- -synopsis: 'Improve "Cannot read .cabal file inside ..." errors' -packages: [cabal-install] -prs: 10647 ---- - -The error message printed when Cabal fails to read a `.cabal` file inside an -index (like the Hackage index) has been greatly improved. Additionally, -warnings in `.cabal` files in indexes are printed instead of being silently -discarded. diff --git a/changelog.d/pr-10705 b/changelog.d/pr-10705 deleted file mode 100644 index e150428ca27..00000000000 --- a/changelog.d/pr-10705 +++ /dev/null @@ -1,8 +0,0 @@ ---- -synopsis: 'Add support for Windows Aarch64' -packages: [Cabal, cabal-install] -prs: 10705 ---- - -Adds to preprocessor branches the option to support `aarch64_HOST_ARCH` platform on Windows Aarch64 target. -`ccall` convention is used at Aarch64, same as for `x86_64_HOST_ARCH`. Introduce `zIsAarch64` to make paths generation support Windows Aarch64 target. diff --git a/changelog.d/pr-10805.md b/changelog.d/pr-10805.md deleted file mode 100644 index 5b3bf8b2c05..00000000000 --- a/changelog.d/pr-10805.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -synopsis: Merge 'flags' stanzas in cabal.project files -packages: [cabal-install] -prs: 10805 -issues: [10767] ---- - -Merge 'flags' stanzas in cabal.project files. Now - -``` -flags: -foo -flags: -bar -``` - -is equivalent to `flags: -foo -bar` while before it was equivalent to `flags: -bar` -(only the latest stanza was taken into account, the other ones were silently -ignored). diff --git a/changelog.d/pr-10816.md b/changelog.d/pr-10816.md deleted file mode 100644 index 06118ecbb5b..00000000000 --- a/changelog.d/pr-10816.md +++ /dev/null @@ -1,23 +0,0 @@ -synopsis: "Add checks for Windows reserved filenames in module paths" -packages: Cabal cabal-install -prs: #10816 -issues: #10295 - -description: { - -On Windows, certain filenames are reserved by the operating system such as -"aux", "con", "prn", "nul", etc. When these names appear in module paths they -can cause build failures on Windows systems. - -`cabal check` now properly warns about module paths that contain Windows reserved -filenames, not just filepaths which contain these reserved tokens. These warnings -are controlled by the existing `invalid-win-path` category. - -For example, module paths like: -- `Exe.Aux.Test` -- `Test.Aux.Module` -- `Bench.Aux.Helpers` - -will now trigger appropriate warnings during `cabal check`. - -} diff --git a/changelog.d/pr-10817 b/changelog.d/pr-10817 deleted file mode 100644 index 4e559b36e15..00000000000 --- a/changelog.d/pr-10817 +++ /dev/null @@ -1,12 +0,0 @@ -synopsis: Fix PATH changes not triggering REPL reconfiguration -packages: cabal-install -prs: #10817 -issues: #2015 - -Previously, if you changed your PATH after initial configuration, Cabal would -continue using the old PATH settings in REPL sessions without warning. -With this fix, Cabal properly detects PATH changes and reconfigures the REPL -accordingly, ensuring tools and libraries in your current PATH are available. -While this may cause additional rebuilds when PATH changes, it prevents the -confusing errors that could occur when your REPL environment didn't match your -system configuration. diff --git a/changelog.d/pr-10828.md b/changelog.d/pr-10828.md deleted file mode 100644 index d364b7cb252..00000000000 --- a/changelog.d/pr-10828.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -synopsis: "Isolate Cabal from the GHC_ENVIRONMENT variable" -packages: [Cabal] -prs: 10828 10990 - -issues: 10759 ---- - -For GHC 8.4.4 and later, Cabal now passes the `-package-env=-` flag to GHC. -This prevents the `GHC_ENVIRONMENT` variable or any package environment files -from affecting Cabal builds. - -This change eliminates unexpected build behavior that could occur when users -had GHC environment files configured in their system that Cabal wasn't aware -of. diff --git a/changelog.d/pr-10830.md b/changelog.d/pr-10830.md deleted file mode 100644 index 21d179f0d06..00000000000 --- a/changelog.d/pr-10830.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -synopsis: Set _datadir to an absolute path when running tests -packages: [Cabal] -prs: 10830 -issues: [10717] ---- - -Fix a regression where `_datadir` was set to a relative path. This -caused issues when running testsuites which changed the working directory and -accessed datafiles. diff --git a/changelog.d/pr-10840.md b/changelog.d/pr-10840.md deleted file mode 100644 index 0652ba03ca2..00000000000 --- a/changelog.d/pr-10840.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -synopsis: Fix gen-bounds command to work in multi-package projects -packages: [cabal-install] -prs: 10840 -issues: [7504] ---- - -`cabal gen-bounds` now works in multi-package projects. - -The command has been reimplemented to use the cabal.project infrastructure (similar -to other v2 commands), allowing it to be aware of all packages defined in the cabal.project -file, regardless of which directory it's executed from. - -``` -$ cat cabal.project -packages: package-a/ - package-b/ - -$ cd package-b/ -$ cabal gen-bounds -Configuration is affected by the following files: -- cabal.project -Resolving dependencies... - -The following packages need bounds and here is a suggested starting point... -For component package-b:lib:package-b: -package-a >= 0.1.0 && < 0.2, -``` diff --git a/changelog.d/pr-10844.md b/changelog.d/pr-10844.md deleted file mode 100644 index 184992f8ba2..00000000000 --- a/changelog.d/pr-10844.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -synopsis: Pass CXX and CXXFLAGS to ./configure scripts run by Configure build-type -packages: [Cabal] -prs: 10844 -issues: [10797] ---- - -./configure scripts run by build-type: Configure will now be passed the CXX and -CXXFLAGS variables. These reflect the path and flags for the C++ compiler. - -If the compiler is not available, then the flags are not passed. For GHC versions >= 9.4.*, -the CXX variable will always be set and available to be used. - -This can be useful for implementing something like `system-cxx-std-lib` in user-land. diff --git a/changelog.d/pr-10880.md b/changelog.d/pr-10880.md deleted file mode 100644 index 6b8defe7eb5..00000000000 --- a/changelog.d/pr-10880.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -synopsis: 'Fix multi-repl when using reexported-modules with renaming for GHC >= 9.12' -packages: [cabal-install, Cabal] -prs: 10880 -issues: 10181 ---- - -Since GHC 9.12, the `-reexported-module` flag has supported module renaming. Therefore -we now use that functionality when starting the multi-repl if it is needed. A new -error message is added to catch the case where you attempt to load a project which -uses this complicated export form but are using < 9.12. - diff --git a/changelog.d/pr-10908.md b/changelog.d/pr-10908.md deleted file mode 100644 index 15b9efcc932..00000000000 --- a/changelog.d/pr-10908.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -synopsis: Remove dead build-tool greencard -packages: [Cabal,cabal-install] -prs: 10908 ---- - -Remove knowledge of the build-tool `greencard` (non-existing since GHC 7.10) -and the connect of the `.gc` extension to this build-tool. diff --git a/changelog.d/pr-10912.md b/changelog.d/pr-10912.md deleted file mode 100644 index 01c48da42c1..00000000000 --- a/changelog.d/pr-10912.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -synopsis: Remove knowledge about hmake and haskell-suite -packages: [Cabal, cabal-install] -prs: 10912 ---- - -The `hmake` tool has long been abandoned, and the `haskell-suite` compiler did not emerge. -Knowledge about these tools has been removed from `Cabal`. diff --git a/changelog.d/pr-10936.md b/changelog.d/pr-10936.md deleted file mode 100644 index f005f2015d5..00000000000 --- a/changelog.d/pr-10936.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -synopsis: Print out the "Created semaphore" message only in verbose mode (#10885) -packages: [cabal-install] -prs: 10936 -issues: 10885 ---- diff --git a/changelog.d/pr-10940 b/changelog.d/pr-10940 deleted file mode 100644 index 4023cfe3af9..00000000000 --- a/changelog.d/pr-10940 +++ /dev/null @@ -1,17 +0,0 @@ ---- -synopsis: print out project files only when run below the project root (or verbose) -packages: [cabal-install] -prs: 10940 -issues: 10885 ---- - -After #10507, cabal prints out what project files are in use on every run. -This looked too noisy for some users (#10885). In this patch, we implement a more nuanced -strategy: print out this info only when cabal is run below the root project directory. -As before, you can get this information uncoditionally if run in the verbose mode. - -Bonus: we now also print the project root directory along with the file names. -Before, we only printed, say, `cabal.project`, but it wasn't clear where this file is -coming from (can be anywhere up the directory tree). -The change tries to avoid confusion when cabal picks up stray project files in -ancestor directories, see discussion in #7930. diff --git a/changelog.d/pr-10941 b/changelog.d/pr-10941 deleted file mode 100644 index 2b4b56e5055..00000000000 --- a/changelog.d/pr-10941 +++ /dev/null @@ -1,8 +0,0 @@ ---- -synopsis: "Haddock documentation added to Paths_pkgname and PackageInfo_pkgname modules" -packages: [Cabal] -prs: 10941 ---- - -The automatically-generated modules `Paths_pkgname` and `PackageInfo_pkgname` -now include Haddock documentation. diff --git a/changelog.d/pr-10948.md b/changelog.d/pr-10948.md deleted file mode 100644 index 83757e5f47e..00000000000 --- a/changelog.d/pr-10948.md +++ /dev/null @@ -1,18 +0,0 @@ -synopsis: Make `Flag a` a type synonym for `Last (Maybe a)` -packages: Cabal cabal-install -prs: #10948 - -description: { - -- Replace `data Flag a = Flag a | NoFlag` with `type Flag = Data.Monoid.Last` - and provide `pattern Flag a = Last (Just a)` and `pattern NoFlag = Last Nothing` - for backward compatibility. -- The change aims to be non-breaking for the majority of clients, although - imports of form `import Distribution.Simple.Flag (Flag (..))` should be replaced - with `import Distribution.Simple.Flag (Flag, pattern Flag, pattern NoFlag)` - (the latter form is backwards compatible with older versions of Cabal). - Enable language extension `PatternSynonyms` if required. In the unlikely case - of defining instances for `Flag`, `TypeSynonymInstances` extension - is needed. - -} diff --git a/changelog.d/pr-10949.md b/changelog.d/pr-10949.md deleted file mode 100644 index ccb15cd0b36..00000000000 --- a/changelog.d/pr-10949.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -synopsis: "ghc-options added to js, cmm and asm" -packages: [Cabal] -prs: 10949 ---- - -Now we have the ability to pass ghc-options flags to all component. - -``` - js-sources: jsbits/lib.js - ghc-options: -optJSP-your_flag -``` - diff --git a/changelog.d/pr-10966.md b/changelog.d/pr-10966.md deleted file mode 100644 index 7761ddb8bda..00000000000 --- a/changelog.d/pr-10966.md +++ /dev/null @@ -1,20 +0,0 @@ -synopsis: Allow build-type: Configure -packages: cabal-install -prs: #10966 -issues: #4548 -significance: significant - -description: { - - This change allows the `build-type: Configure` field to be used in - Cabal packages in conjunction with components. (E.g. public sublibraries). - This is a significant change as it enables the use of the `Configure` build - type, which cabal bailed on previously. - - This does change the behaviour of cabal-install for packages that contain - `build-type: Configure`. We now always build them as components with - cabal-install. Previously we would turn packages with main libraries, and - executables/benchmarks/tests-suites into a single package to be built in a - compatibility mode. This is no longer the case. - -} diff --git a/changelog.d/pr-10967.md b/changelog.d/pr-10967.md deleted file mode 100644 index 96d59d6de36..00000000000 --- a/changelog.d/pr-10967.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -synopsis: Adding JavaScript Preprocessor Support -packages: [Cabal, Cabal-syntax] -prs: 10967 ---- - -Adding new syntax jspp-options that would support the -optJSP preprocessor flag for js sources. - -``` - js-sources: jsbits/lib.js - jspp-options: -DYOUR_FLAG -``` - diff --git a/changelog.d/pr-10979 b/changelog.d/pr-10979 deleted file mode 100644 index 7e3fb85502c..00000000000 --- a/changelog.d/pr-10979 +++ /dev/null @@ -1,8 +0,0 @@ -synopsis: Fix parsing the AbiTag with development versions of GHC -packages: Cabal -prs: #10979 -issues: #10170 - -description: { -- Allow parsing the AbiTag for developmement versions of GHC. -} diff --git a/changelog.d/pr-10991.md b/changelog.d/pr-10991.md deleted file mode 100644 index 19bb10d99ed..00000000000 --- a/changelog.d/pr-10991.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -synopsis: "Take --working-dir into account in runPreProcessorWithHsBootHack" -packages: [Cabal] -prs: 10991 -issues: [11000] ---- - -The preprocessor hs-boot hack handles the situation in which a file to be -preprocessed is supplied alongside an hs-boot file, e.g. Foo.x and Foo.hs-boot -are given together. - -This code now respects the --working-dir Cabal global argument. This fixes -build failures of the form: - - attempting to use module `Foo` (Foo.hs-boot) which is not loaded diff --git a/changelog.d/pr-10992.md b/changelog.d/pr-10992.md deleted file mode 100644 index de3a89df3bf..00000000000 --- a/changelog.d/pr-10992.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -synopsis: "Haddock: don't try to copy build dir if it doesn't exist" -packages: [Cabal] -prs: 10992 -issues: [11001] ---- - -This small patch fixes a little oversight in 'reusingGHCCompilationArtifacts', -which would unconditionally attempt to copy over the GHC build artifacts to be -re-used by Haddock, even when those artifacts did not exist (which caused -an error). diff --git a/changelog.d/pr-11003.md b/changelog.d/pr-11003.md deleted file mode 100644 index cdab59c146c..00000000000 --- a/changelog.d/pr-11003.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -synopsis: Make lukko flag automatic and off by default -packages: [cabal-install] -prs: 11003 -issues: 10724 ---- - -Make `lukko` flag automatic and off by default, using file locking facilities from `base:GHC.IO.Handle.Lock` and not from the `lukko` package. The change is not expected to affect anyone detrimentally, but one can set the flag on in their configuration to restore the previous behaviour. diff --git a/changelog.d/pr-11014 b/changelog.d/pr-11014 deleted file mode 100644 index c24391a1d65..00000000000 --- a/changelog.d/pr-11014 +++ /dev/null @@ -1,9 +0,0 @@ -synopsis: add SPDX license data version 3.26 -packages: Cabal -prs: #11014 - -description: { - -- Update SPDX license list to version 3.26.0 2024-12-30 - -} diff --git a/changelog.d/pr-9367 b/changelog.d/pr-9367 deleted file mode 100644 index 806efcc5c11..00000000000 --- a/changelog.d/pr-9367 +++ /dev/null @@ -1,21 +0,0 @@ ---- -synopsis: "Use response files when calling `ghc`" -packages: [Cabal] -prs: 9367 ---- - -Cabal now passes GHC arguments through a response file. This prevents an error -where very large packages would fail to build due to the module names exceeding -the `ARG_MAX` command-line length limit: - -``` -ghc: createProcess: posix_spawnp: resource exhausted (Argument list too long) -``` - -Notes: -- Response files will not be used if the first argument to `ghc` is - `--interactive`. -- RTS options (like `+RTS -H32m -S -RTS`) will not be included in response - files. -- For reproducing commands after Cabal exits, `--keep-temp-files` can be used - to prevent the response files from being deleted. diff --git a/changelog.d/pr-9744.md b/changelog.d/pr-9744.md deleted file mode 100644 index 6f149d82162..00000000000 --- a/changelog.d/pr-9744.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -synopsis: Discover targets in a project -packages: [cabal-install] -prs: 9744 -issues: [4070,8953] -significance: significant ---- - -Adds a `cabal target` command that is useful for discovering targets in a -project for use with other commands taking ``[TARGETS]``. - -Any target form except for a script target can be used with ``cabal target``. - -This command, like many others, takes ``[TARGETS]``. Taken together, these will -select for a set of targets in the project. When none are supplied, the command -acts as if ``all`` was supplied. Targets in the returned subset are shown sorted -and fully-qualified with package, component type and component name such as -`Cabal-tests:test:hackage-tests`. diff --git a/changelog.d/pr-9890 b/changelog.d/pr-9890 deleted file mode 100644 index e9861aed7af..00000000000 --- a/changelog.d/pr-9890 +++ /dev/null @@ -1,10 +0,0 @@ -synopsis: `cabal init` generates explicit export lists for Main -packages: cabal-install -prs: #9890 -issues: #9889 - -description: { - -- Lack of explicit export list can degrade performance. The `Main` module in particular should always have an explicit export list that contains just the main function. Then, the compiler can do more aggressive optimizations on all the other non-exported functions. - -} diff --git a/release-notes/Cabal-3.16.0.0.md b/release-notes/Cabal-3.16.0.0.md new file mode 100644 index 00000000000..dca6d293e36 --- /dev/null +++ b/release-notes/Cabal-3.16.0.0.md @@ -0,0 +1,199 @@ +Cabal and Cabal-syntax 3.16.0.0 changelog and release notes +--- + +### Significant changes + +- Make `Flag a` a type synonym for `Last (Maybe a)` [#10948](https://github.com/haskell/cabal/pull/10948) + + Refer to the [Migration guide](#migration-guide) for an upgrade path. + +- Add support for Windows AArch64 [#10705](https://github.com/haskell/cabal/pull/10705) + + Adds to preprocessor branches the option to support the `aarch64_HOST_ARCH` platform on the Windows AArch64 target. + The `ccall` convention is used on AArch64, as with `x86_64_HOST_ARCH`. Introduce `zIsAArch64` to make paths generation support the Windows AArch64 target. + +### Other changes + +- Add `--with-repl` flag to specify alternative REPL program [#9115](https://github.com/haskell/cabal/issues/9115) [#10996](https://github.com/haskell/cabal/pull/10996) + + Added a new `--with-repl` command-line option that allows specifying an alternative + program to use when starting a REPL session, instead of the default GHC. + + This is particularly useful for tools like `doctest` and `hie-bios` that need to + intercept the REPL session to perform their own operations. Previously, these tools + had to use `--with-ghc` which required them to proxy all GHC invocations, including + dependency compilation, making the implementation more complex. + + The `--with-repl` option only affects the final REPL invocation, simplifying the + implementation of such wrapper tools. + + Example usage: + ```bash + cabal repl --with-repl=doctest + cabal repl --with-repl=/path/to/custom/ghc + ``` + + This change also removes the special handling for response files with `--interactive` + mode, as tools are now expected to handle response files appropriately. + +- In the warning about Haddock docs not being installed, don't imply that the docs exist [#9694](https://github.com/haskell/cabal/issues/9694) [#9695](https://github.com/haskell/cabal/pull/9695) + +- Show why `cabal act-as-setup configure` failed [#10273](https://github.com/haskell/cabal/pull/10273) + + When configuring fails, we print a list of "missing or private dependencies". + + Now, it will show you if each failing dependency is missing, private, or an + incompatible version: + + ``` + Error: [Cabal-8010] + Encountered missing or private dependencies: + Lib:{bar-internal,foo-internal} (missing :bar-internal), + base <=1.0 (installed: 4.18.2.1), + package-that-does-not-exist (missing) + ``` + +- Avoid partial `Data.List.last` in autogenerated `Paths_.hs` [#10432](https://github.com/haskell/cabal/pull/10432) + + - Autogenerated `Paths_.hs` now avoids use of the partial function `Data.List.last`. + +- Fix Haddock CSS handling in multi-package projects [#10636](https://github.com/haskell/cabal/issues/10636) [#10637](https://github.com/haskell/cabal/pull/10637) + + When the `--css=` flag is provided to `cabal haddock-project`: + + - the Haddock index is now properly styled by the provided CSS file + - each package in the project now has its docs properly styled by the provided CSS file + +- Add checks for Windows reserved filenames in module paths [#10295](https://github.com/haskell/cabal/issues/10295) [#10816](https://github.com/haskell/cabal/pull/10816) + + On Windows, certain filenames are reserved by the operating system such as + "aux", "con", "prn", "nul", etc. When these names appear in module paths they + can cause build failures on Windows systems. + + `cabal check` now properly warns about module paths that contain Windows reserved + filenames, not just filepaths which contain these reserved tokens. These warnings + are controlled by the existing `invalid-win-path` category. + + For example, module paths like: + - `Exe.Aux.Test` + - `Test.Aux.Module` + - `Bench.Aux.Helpers` + + will now trigger appropriate warnings during `cabal check`. + +- Isolate Cabal from the GHC_ENVIRONMENT variable [#10759](https://github.com/haskell/cabal/issues/10759) [#10828](https://github.com/haskell/cabal/pull/10828) [#10990](https://github.com/haskell/cabal/pull/10990) + + For GHC 8.4.4 and later, Cabal now passes the `-package-env=-` flag to GHC. + This prevents the `GHC_ENVIRONMENT` variable or any package environment files + from affecting Cabal builds. + + This change eliminates unexpected build behavior that could occur when users + had GHC environment files configured in their system that Cabal wasn't aware + of. + +- Set `_datadir` to an absolute path when running tests [#10717](https://github.com/haskell/cabal/issues/10717) [#10830](https://github.com/haskell/cabal/pull/10830) + + Fix a regression where `_datadir` was set to a relative path. This + caused issues when running testsuites which changed the working directory and + accessed datafiles. + +- Pass `CXX` and `CXXFLAGS` to `./configure` scripts run by Configure build-type [#10797](https://github.com/haskell/cabal/issues/10797) [#10844](https://github.com/haskell/cabal/pull/10844) + + `./configure` scripts run by `build-type: Configure` will now be passed the `CXX` and + `CXXFLAGS` variables. These reflect the path and flags for the C++ compiler respectively. + + If the compiler is not available, then the flags are not passed. For GHC versions `>= 9.4.*`, + the `CXX` variable will always be set and available to be used. + + This can be useful for implementing something like `system-cxx-std-lib` in user-land. + +- Remove dead build-tool greencard [#10908](https://github.com/haskell/cabal/pull/10908) + + Remove knowledge of the build-tool `greencard` (non-existing since GHC 7.10) + and the connect of the `.gc` extension to this build-tool. + +- Remove knowledge about hmake and haskell-suite [#10912](https://github.com/haskell/cabal/pull/10912) + + The `hmake` tool has long been abandoned, and the `haskell-suite` compiler did not emerge. + Knowledge about these tools has been removed from `Cabal`. + +- Haddock documentation added to Paths_pkgname and PackageInfo_pkgname modules [#10941](https://github.com/haskell/cabal/pull/10941) + + The automatically-generated modules `Paths_pkgname` and `PackageInfo_pkgname` + now include Haddock documentation. + +- `ghc-options` take effect for components built out of js-, cmm- and asm-sources [#10949](https://github.com/haskell/cabal/pull/10949) + + Now we have the ability to pass `ghc-options` flags to all component. + + ``` + js-sources: jsbits/lib.js + ghc-options: -optJSP-your_flag + ``` + +- Adding JavaScript Preprocessor Support [#10967](https://github.com/haskell/cabal/pull/10967) + + Adding new syntax `jspp-options` that would support the `-optJSP` preprocessor flag for js sources. + + ``` + js-sources: jsbits/lib.js + jspp-options: -DYOUR_FLAG + ``` + +- Fix parsing the AbiTag with development versions of GHC [#10170](https://github.com/haskell/cabal/issues/10170) [#10979](https://github.com/haskell/cabal/pull/10979) + +- Take `--working-dir` into account in `runPreProcessorWithHsBootHack` [#11000](https://github.com/haskell/cabal/issues/11000) [#10991](https://github.com/haskell/cabal/pull/10991) + + The preprocessor hs-boot hack handles the situation in which a file to be + preprocessed is supplied alongside an hs-boot file, e.g. Foo.x and Foo.hs-boot + are given together. + + This code now respects the `--working-dir` Cabal global argument. This fixes + build failures of the form: + + ``attempting to use module `Foo' (Foo.hs-boot) which is not loaded`` + +- Haddock: don't try to copy build dir if it doesn't exist [#11001](https://github.com/haskell/cabal/issues/11001) [#10992](https://github.com/haskell/cabal/pull/10992) + + This small patch fixes a little oversight in 'reusingGHCCompilationArtifacts', + which would unconditionally attempt to copy over the GHC build artifacts to be + re-used by Haddock, even when those artifacts did not exist (which caused + an error). + +- add SPDX license data version 3.26 [#11014](https://github.com/haskell/cabal/pull/11014) + + - Update SPDX license list to version 3.26.0 2024-12-30 + +- Use response files when calling `ghc` [#9367](https://github.com/haskell/cabal/pull/9367) + + Cabal now passes GHC arguments through a response file. This prevents an error + where very large packages would fail to build due to the module names exceeding + the `ARG_MAX` command-line length limit: + + ``` + ghc: createProcess: posix_spawnp: resource exhausted (Argument list too long) + ``` + + Notes: + - RTS options (like `+RTS -H32m -S -RTS`) will not be included in response + files. + - For reproducing commands after Cabal exits, `--keep-temp-files` can be used + to prevent the response files from being deleted. + +- New licence constructors for SPDX licences starting with a digit [#10356](https://github.com/haskell/cabal/pull/10356) + + - LicenseId constructor `NullBSD` is now `N_0BSD`. + - LicenseId constructor `DS389_exception` is now and `N_389_exception`. + - LicenseId constructor `X3D_Slicer_1_0` is now and `N_3D_Slicer_1_0`. + +### Migration guide + +- `data Flag a = Flag a | NoFlag` has been replaced with `type Flag = Data.Monoid.Last`, + while `pattern Flag a = Last (Just a)` and `pattern NoFlag = Last Nothing` are provided + for backward compatibility. + Imports of form `import Distribution.Simple.Flag (Flag (..))` should be replaced + with `import Distribution.Simple.Flag (Flag, pattern Flag, pattern NoFlag)` + (the latter form is backwards compatible with older versions of Cabal). + Enable `{-# LANGUAGE PatternSynonyms #-}` if required. In the unlikely case + of defining instances for `Flag`, `{-# LANGUAGE TypeSynonymInstances #-}` + is needed. diff --git a/release-notes/WIP-Cabal-3.16.x.0.md b/release-notes/WIP-Cabal-3.16.x.0.md deleted file mode 100644 index 1c208dbcf4d..00000000000 --- a/release-notes/WIP-Cabal-3.16.x.0.md +++ /dev/null @@ -1,18 +0,0 @@ -Cabal 3.16.x.0 changelog and release notes. - -This file will be edited and the changes incorporated into the official -3.16.x.0 Cabal and Cabal-syntax release notes. - ---- - -### Migration guide - -- `data Flag a = Flag a | NoFlag` has been replaced with `type Flag = Data.Monoid.Last`, - while `pattern Flag a = Last (Just a)` and `pattern NoFlag = Last Nothing` are provided - for backward compatibility. - Imports of form `import Distribution.Simple.Flag (Flag (..))` should be replaced - with `import Distribution.Simple.Flag (Flag, pattern Flag, pattern NoFlag)` - (the latter form is backwards compatible with older versions of Cabal). - Enable `{-# LANGUAGE PatternSynonyms #-}` if required. In the unlikely case - of defining instances for `Flag`, `{-# LANGUAGE TypeSynonymInstances #-}` - is needed. diff --git a/release-notes/cabal-install-3.16.0.0.md b/release-notes/cabal-install-3.16.0.0.md new file mode 100644 index 00000000000..ee98d7ead6b --- /dev/null +++ b/release-notes/cabal-install-3.16.0.0.md @@ -0,0 +1,292 @@ +cabal-install 3.16.0.0 changelog and release notes. +--- + + +### Significant changes + +- Allow `build-type: Configure` to work with components (including public sub-libraries) [#4548](https://github.com/haskell/cabal/issues/4548) [#10966](https://github.com/haskell/cabal/pull/10966) + + This change allows the `build-type: Configure` field to be used in + Cabal packages in conjunction with components. (E.g. public sublibraries). + This is a significant change as it enables the use of the `Configure` build + type, which cabal bailed on previously. + + This does change the behaviour of cabal-install for packages that contain + `build-type: Configure`. We now always build them as components with + cabal-install. Previously we would turn packages with main libraries, and + executables/benchmarks/tests-suites into a single package to be built in a + compatibility mode. This is no longer the case. + +- Discover targets in a project [#4070](https://github.com/haskell/cabal/issues/4070) [#8953](https://github.com/haskell/cabal/issues/8953) [#9744](https://github.com/haskell/cabal/pull/9744) + + Adds a `cabal target` command that is useful for discovering targets in a + project for use with other commands taking ``[TARGETS]``. + + Any target form except for a script target can be used with ``cabal target``. + + This command, like many others, takes ``[TARGETS]``. Taken together, these will + select for a set of targets in the project. When none are supplied, the command + acts as if ``all`` was supplied. Targets in the returned subset are shown sorted + and fully-qualified with package, component type and component name such as + `Cabal-tests:test:hackage-tests`. + +- Add `--with-repl` flag to specify alternative REPL program [#9115](https://github.com/haskell/cabal/issues/9115) [#10996](https://github.com/haskell/cabal/pull/10996) + + Added a new `--with-repl` command-line option that allows specifying an alternative + program to use when starting a REPL session, instead of the default GHC. + + This is particularly useful for tools like `doctest` and `hie-bios` that need to + intercept the REPL session to perform their own operations. Previously, these tools + had to use `--with-ghc` which required them to proxy all GHC invocations, including + dependency compilation, making the implementation more complex. + + The `--with-repl` option only affects the final REPL invocation, simplifying the + implementation of such wrapper tools. + + Example usage: + ```bash + cabal repl --with-repl=doctest + cabal repl --with-repl=/path/to/custom/ghc + ``` + + This change also removes the special handling for response files with `--interactive` + mode, as tools are now expected to handle response files appropriately. + +### Other changes + +- Fix `cabal clean` permissions on Windows [#10182](https://github.com/haskell/cabal/issues/10182) [#10190](https://github.com/haskell/cabal/pull/10190) + + - `cabal clean` now removes the read-only mark recursively in the `dist-newstyle` folder on Windows before attempting to delete it. + +- Shallow and concurrent cloning of git repositories [#10254](https://github.com/haskell/cabal/pull/10254) + + - Clone git repositories specified in `source-repository-package` stanzas + shallowly, since to build the package from the repository we only need to + read the commit specified. The rest of the repo is not needed. + Note that this does not change the behaviour of `cabal get -s`, which will + still clone the repository in full. + - Clone VCS repositories concurrently, with a maximum of two concurrent tasks + at the same time (just like when downloading packages asynchronously) + +- Don't run submodule commands unless necessary [#10590](https://github.com/haskell/cabal/pull/10590) + + When `cabal` clones a Git repo for a `source-repository-package` listed in a + `cabal.project`, it will run various commands to check out the correct + revision, initialize submodules if they're present, and so on. + + Now, `cabal` will avoid running `git submodule` commands unless the cloned + repository contains a `.gitmodules` file. This will declutter `cabal`'s debug + output by running fewer commands. + +- A trailing colon after a stanza name in `cabal.project` is now an error [#10525](https://github.com/haskell/cabal/pull/10525) + + It is now a hard error to use a trailing colon after a stanza name in + `cabal.project` or `*.cabal` files: + + ``` + packages: . + + source-repository-package: + type: git + location: https://github.com/haskell/cabal + tag: f34aba976a60940295f41b6649674e9568893894 + ``` + + ``` + $ cabal build + Error parsing project file cabal.project:3: + 'source-repository-package' is a stanza, not a field. Remove the trailing ':' to parse a stanza. + ``` + + Previously, the warning message was easily ignored and somewhat misleading, as + the difference between a stanza and a field is not immediately obvious to + Haskellers used to config languages like JSON and YAML (which don't distinguish + between fields which have string or list values and stanzas which have nested + fields): + + ``` + Warning: cabal.project: Unrecognized field + 'source-repository-package' on line 3 + ``` + +- Warn on `cabal format` [#10549](https://github.com/haskell/cabal/pull/10549) + + - Despite its name, `cabal format` is not a proper formatter for cabal files. By chance users have sometimes found the command even though it is not mentioned in the help text, and they used it to format cabal files. This has some downsides like comments are stripped away or common stanzas are inlined, the command is more like a dump of the resolved package description. There are future plans ([#7544](https://github.com/haskell/cabal/issues/7544)) to make it an actual formatter so, rather than going through a deprecation cycle, we decided to keep this command for future use and in the meantime just warn the user about the fact that it is not a proper formatter. + +- Quieter Git output [#10587](https://github.com/haskell/cabal/pull/10587) + + When `cabal` clones a Git repo for a `source-repository-package` listed in a + `cabal.project`, it will run various commands to check out the correct + revision, initialize submodules if they're present, and so on. + + Now, `cabal` will pass `--quiet` to Git in more cases to help prevent + cluttering command-line output. + +- Report trailing spaces in project import URIs [#10622](https://github.com/haskell/cabal/issues/10622) [#10629](https://github.com/haskell/cabal/pull/10629) + + > A string is a valid URL potentially surrounded by spaces if, after stripping + > leading and trailing whitespace from it, it is a valid URL." + > SOURCE: [W3C/HTML5/URLs](https://www.w3.org/TR/2010/WD-html5-20100624/urls.html) + + Fixes a problem of mistaking a URI for a file path when it has trailing spaces + and warn about such trailing spaces. + +- Fix Haddock CSS handling in multi-package projects [#10636](https://github.com/haskell/cabal/issues/10636) [#10637](https://github.com/haskell/cabal/pull/10637) + + When `--css=` flag is provided to `cabal haddock-project`: + + - the Haddock index is now properly styled by the provided CSS file + - each package in the project now has their docs properly styled by the provided CSS file + +- Show source of project parse error or warning [#10635](https://github.com/haskell/cabal/issues/10635) [#10644](https://github.com/haskell/cabal/pull/10644) + + Improves warning and error messages shown when parsing project files and their + imports. + +- Improve "Cannot read .cabal file inside ..." errors [#10647](https://github.com/haskell/cabal/pull/10647) + + The error message printed when Cabal fails to read a `.cabal` file inside an + index (like the Hackage index) has been greatly improved. Additionally, + warnings in `.cabal` files in indexes are printed instead of being silently + discarded. + +- Add support for Windows AArch64 [#10705](https://github.com/haskell/cabal/pull/10705) + + Adds to preprocessor branches the option to support `aarch64_HOST_ARCH` platform on Windows AArch64 target. + `ccall` convention is used at AArch64, same as for `x86_64_HOST_ARCH`. Introduce `zIsAArch64` to make paths generation support Windows AArch64 target. + +- Merge `flags` stanzas in cabal.project files instead of taking the last [#10767](https://github.com/haskell/cabal/issues/10767) [#10805](https://github.com/haskell/cabal/pull/10805) + + Now + + ``` + flags: -foo + flags: -bar + ``` + + is equivalent to `flags: -foo -bar` while before it was equivalent to `flags: -bar` + (only the latest stanza was taken into account, the other ones were silently + ignored). + +- Add checks for Windows reserved filenames in module paths [#10295](https://github.com/haskell/cabal/issues/10295) [#10816](https://github.com/haskell/cabal/pull/10816) + + On Windows, certain filenames are reserved by the operating system such as + "aux", "con", "prn", "nul", etc. When these names appear in module paths they + can cause build failures on Windows systems. + + `cabal check` now properly warns about module paths that contain Windows reserved + filenames, not just filepaths which contain these reserved tokens. These warnings + are controlled by the existing `invalid-win-path` category. + + For example, module paths like: + - `Exe.Aux.Test` + - `Test.Aux.Module` + - `Bench.Aux.Helpers` + + will now trigger appropriate warnings during `cabal check`. + +- Fix `gen-bounds` command to work in multi-package projects [#7504](https://github.com/haskell/cabal/issues/7504) [#10840](https://github.com/haskell/cabal/pull/10840) + + The command has been reimplemented to use the cabal.project infrastructure (similar + to other v2 commands), allowing it to be aware of all packages defined in the cabal.project + file, regardless of which directory it's executed from. + + ``` + $ cat cabal.project + packages: package-a/ + package-b/ + + $ cd package-b/ + $ cabal gen-bounds + Configuration is affected by the following files: + - cabal.project + Resolving dependencies... + + The following packages need bounds and here is a suggested starting point... + For component package-b:lib:package-b: + package-a >= 0.1.0 && < 0.2, + ``` + +- Fix multi-repl when using reexported-modules with renaming for GHC >= 9.12 [#10181](https://github.com/haskell/cabal/issues/10181) [#10880](https://github.com/haskell/cabal/pull/10880) + + Since GHC 9.12, the `-reexported-module` flag has supported module renaming. Therefore + we now use that functionality when starting the multi-repl if it is needed. A new + error message is added to catch the case where you attempt to load a project which + uses this complicated export form but are using < 9.12. + +- Remove dead build-tool `greencard` [#10908](https://github.com/haskell/cabal/pull/10908) + + Remove knowledge of the build-tool `greencard` (non-existing since GHC 7.10) + and the connect of the `.gc` extension to this build-tool. + +- Remove knowledge about `hmake` and `haskell-suite` [#10912](https://github.com/haskell/cabal/pull/10912) + + The `hmake` tool has long been abandoned, and the `haskell-suite` compiler did not emerge. + Knowledge about these tools has been removed from `Cabal`. + +- Print out the "Created semaphore" message only in verbose mode [#10885](https://github.com/haskell/cabal/issues/10885) [#10936](https://github.com/haskell/cabal/pull/10936) + +- Print out project files only when run below the project root (or verbose) [#10885](https://github.com/haskell/cabal/issues/10885) [#10940](https://github.com/haskell/cabal/pull/10940) + + After [#10507](https://github.com/haskell/cabal/pull/10507) released in + cabal-install-3.14, cabal prints out what project files are in use on every run. + + This looked too noisy for some users + ([#10885]((https://github.com/haskell/cabal/issues/10885))). In this patch, + we implement a more nuanced strategy: print out this info only when cabal is + run below the root project directory. + As before, you can get this information unconditionally if run in the verbose mode. + + Bonus: we now also print the project root directory along with the file names. + Before, we only printed, say, `cabal.project`, but it wasn't clear where this file is + coming from (can be anywhere up the directory tree). + The change tries to avoid confusion when cabal picks up stray project files in + ancestor directories, see discussion in + [#7930](https://github.com/haskell/cabal/issues/7930). + +- Make `lukko` flag automatic and off by default [#10724](https://github.com/haskell/cabal/issues/10724) [#11003](https://github.com/haskell/cabal/pull/11003) + + Make `lukko` flag automatic and off by default, using file locking facilities from `base:GHC.IO.Handle.Lock` and not from the `lukko` package. The change is not expected to affect anyone detrimentally, but one can set the flag on in their configuration to restore the previous behaviour. + +- `cabal init` generates explicit export lists for Main [#9889](https://github.com/haskell/cabal/issues/9889) [#9890](https://github.com/haskell/cabal/pull/9890) + + - Lack of explicit export list can degrade performance. The `Main` module in particular should always have an explicit export list that contains just the main function. Then, the compiler can do more aggressive optimizations on all the other non-exported functions. + +- Fix PATH changes not triggering REPL reconfiguration [#2015](https://github.com/haskell/cabal/issues/2015) [#10817](https://github.com/haskell/cabal/pull/10817) + +- Report trailing spaces in project import URIs [#10622](https://github.com/haskell/cabal/issues/10622) [#10629](https://github.com/haskell/cabal/pull/10629) + + > A string is a valid URL potentially surrounded by spaces if, after stripping + > leading and trailing whitespace from it, it is a valid URL." + + Source: [W3C/HTML5/URLs](https://www.w3.org/TR/2010/WD-html5-20100624/urls.html) + + Fixes a problem of mistaking a URI for a file path when it has trailing spaces + and warn about such trailing spaces. + +- Configuration messages without duplicates [#10645](https://github.com/haskell/cabal/issues/10645) [#10646](https://github.com/haskell/cabal/pull/10646) + + The "using configuration from" message no longer has duplicates on Windows when + a `cabal.project` uses forward slashes for its imports but the message reports + the same import again with backslashes. + +### Unresolved + +- curl error with `cabal upload -d` [#10920](https://github.com/haskell/cabal/issues/10920) + + Uploading documentation to Hackage can result in a + `chunk hex-length char not a hex digit` error. + +- New git invocation changes the behaviour of source-repository-package [#10605](https://github.com/haskell/cabal/issues/10605) + + Invoking `cabal build` with `source-repository-package` leads to + errors when the `tag` is specified with abbreviated commit hashes. + +- `extra-libraries` is overwritten by configure script [#10961](https://github.com/haskell/cabal/issues/10961) + + If you have two `extra-libraries`, one in the `.cabal` file and the + second in the configure script, the latter will be appended on the + right. + + If the correct library is picked in the configure script, it is advisable + to remove `extra-libraries` from the `.cabal` file.