From 75638e9dedc07704968fe3ec703b8f21d297be0f Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Thu, 3 Jul 2025 15:29:59 -0400 Subject: [PATCH 01/14] adjust versions for 3.16.0.0 release This commit is directly to 3.16 branch. Note that I discovered two missed version bumps on `master` which must be addressed in a separate PR. --- Cabal-QuickCheck/Cabal-QuickCheck.cabal | 6 +++--- Cabal-described/Cabal-described.cabal | 6 +++--- Cabal-hooks/Cabal-hooks.cabal | 6 +++--- Cabal-syntax/Cabal-syntax.cabal | 2 +- Cabal-tree-diff/Cabal-tree-diff.cabal | 6 +++--- Cabal/Cabal.cabal | 4 ++-- Cabal/Makefile | 2 +- bootstrap/linux-9.10.2.json | 12 ++++++------ bootstrap/linux-9.12.2.json | 12 ++++++------ bootstrap/linux-9.2.8.json | 12 ++++++------ bootstrap/linux-9.4.8.json | 12 ++++++------ bootstrap/linux-9.6.7.json | 12 ++++++------ bootstrap/linux-9.8.4.json | 12 ++++++------ cabal-install-solver/cabal-install-solver.cabal | 6 +++--- cabal-install/cabal-install.cabal | 8 ++++---- cabal-testsuite/cabal-testsuite.cabal | 2 +- doc/conf.py | 2 +- solver-benchmarks/solver-benchmarks.cabal | 2 +- 18 files changed, 62 insertions(+), 62 deletions(-) diff --git a/Cabal-QuickCheck/Cabal-QuickCheck.cabal b/Cabal-QuickCheck/Cabal-QuickCheck.cabal index 56d6fa10675..5d9d723b974 100644 --- a/Cabal-QuickCheck/Cabal-QuickCheck.cabal +++ b/Cabal-QuickCheck/Cabal-QuickCheck.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-QuickCheck -version: 3.17.0.0 +version: 3.16.0.0 synopsis: QuickCheck instances for types in Cabal category: Testing build-type: Simple @@ -14,8 +14,8 @@ library build-depends: , base , bytestring - , Cabal ^>=3.17.0.0 - , Cabal-syntax ^>=3.17.0.0 + , Cabal ^>=3.16.0.0 + , Cabal-syntax ^>=3.16.0.0 , QuickCheck >= 2.13.2 && < 2.17 exposed-modules: diff --git a/Cabal-described/Cabal-described.cabal b/Cabal-described/Cabal-described.cabal index 6bb5a6131f1..70d1acb1e41 100644 --- a/Cabal-described/Cabal-described.cabal +++ b/Cabal-described/Cabal-described.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-described -version: 3.17.0.0 +version: 3.16.0.0 synopsis: Described functionality for types in Cabal category: Testing, Parsec description: Provides rere bindings @@ -12,8 +12,8 @@ library ghc-options: -Wall build-depends: , base - , Cabal ^>=3.17.0.0 - , Cabal-syntax ^>=3.17.0.0 + , Cabal ^>=3.16.0.0 + , Cabal-syntax ^>=3.16.0.0 , containers , pretty , QuickCheck diff --git a/Cabal-hooks/Cabal-hooks.cabal b/Cabal-hooks/Cabal-hooks.cabal index 78e43702f2e..1c7d079d223 100644 --- a/Cabal-hooks/Cabal-hooks.cabal +++ b/Cabal-hooks/Cabal-hooks.cabal @@ -1,6 +1,6 @@ cabal-version: 3.6 name: Cabal-hooks -version: 3.17 +version: 3.16 copyright: 2023, Cabal Development Team license: BSD-3-Clause license-file: LICENSE @@ -27,8 +27,8 @@ library hs-source-dirs: src build-depends: - , Cabal-syntax >= 3.17 && < 3.18 - , Cabal >= 3.17 && < 3.18 + , Cabal-syntax >= 3.16 && < 3.17 + , Cabal >= 3.16 && < 3.17 , base >= 4.13 && < 5 , containers >= 0.5.0.0 && < 0.9 , transformers >= 0.5.6.0 && < 0.7 diff --git a/Cabal-syntax/Cabal-syntax.cabal b/Cabal-syntax/Cabal-syntax.cabal index 266c284e098..d1fcf526063 100644 --- a/Cabal-syntax/Cabal-syntax.cabal +++ b/Cabal-syntax/Cabal-syntax.cabal @@ -1,6 +1,6 @@ cabal-version: 3.6 name: Cabal-syntax -version: 3.17.0.0 +version: 3.16.0.0 copyright: 2003-2024, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE diff --git a/Cabal-tree-diff/Cabal-tree-diff.cabal b/Cabal-tree-diff/Cabal-tree-diff.cabal index 02945f9ba25..5a8d8f9624d 100644 --- a/Cabal-tree-diff/Cabal-tree-diff.cabal +++ b/Cabal-tree-diff/Cabal-tree-diff.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: Cabal-tree-diff -version: 3.17.0.0 +version: 3.16.0.0 synopsis: QuickCheck instances for types in Cabal category: Testing description: Provides tree-diff ToExpr instances for some types in Cabal @@ -11,8 +11,8 @@ library ghc-options: -Wall build-depends: , base - , Cabal-syntax ^>=3.17.0.0 - , Cabal ^>=3.17.0.0 + , Cabal-syntax ^>=3.16.0.0 + , Cabal ^>=3.16.0.0 , tree-diff ^>=0.1 || ^>=0.2 || ^>=0.3 exposed-modules: Data.TreeDiff.Instances.Cabal diff --git a/Cabal/Cabal.cabal b/Cabal/Cabal.cabal index edcf9362e42..8ebff8a642e 100644 --- a/Cabal/Cabal.cabal +++ b/Cabal/Cabal.cabal @@ -1,6 +1,6 @@ cabal-version: 3.6 name: Cabal -version: 3.17.0.0 +version: 3.16.0.0 copyright: 2003-2024, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE @@ -39,7 +39,7 @@ library hs-source-dirs: src build-depends: - , Cabal-syntax ^>= 3.17 + , Cabal-syntax ^>= 3.16 , array >= 0.4.0.1 && < 0.6 , base >= 4.13 && < 5 , bytestring >= 0.10.0.0 && < 0.13 diff --git a/Cabal/Makefile b/Cabal/Makefile index e74ee82079d..d8336f28454 100644 --- a/Cabal/Makefile +++ b/Cabal/Makefile @@ -1,4 +1,4 @@ -VERSION=3.15.0.0 +VERSION=3.16.0.0 #KIND=devel KIND=rc diff --git a/bootstrap/linux-9.10.2.json b/bootstrap/linux-9.10.2.json index 46b95214f69..963e93985ad 100644 --- a/bootstrap/linux-9.10.2.json +++ b/bootstrap/linux-9.10.2.json @@ -124,7 +124,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -136,7 +136,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -146,7 +146,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17" + "version": "3.16" }, { "cabal_sha256": "725ef6da03d3d6e332db4de0a35bee45d72e4d31decc5ec7f153e6837af5f03e", @@ -308,7 +308,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": "0e9de2ccce261e7a5b027e842f6f47f50eb0e6059a0de98a5479f75aa8164107", @@ -487,7 +487,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -501,7 +501,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" } ] } diff --git a/bootstrap/linux-9.12.2.json b/bootstrap/linux-9.12.2.json index c909fa47f35..e51a3efc2b8 100644 --- a/bootstrap/linux-9.12.2.json +++ b/bootstrap/linux-9.12.2.json @@ -128,7 +128,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -140,7 +140,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -150,7 +150,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17" + "version": "3.16" }, { "cabal_sha256": "725ef6da03d3d6e332db4de0a35bee45d72e4d31decc5ec7f153e6837af5f03e", @@ -312,7 +312,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": "0e9de2ccce261e7a5b027e842f6f47f50eb0e6059a0de98a5479f75aa8164107", @@ -479,7 +479,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -493,7 +493,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" } ] } diff --git a/bootstrap/linux-9.2.8.json b/bootstrap/linux-9.2.8.json index 4bdc5fde7cf..3fbb413074b 100644 --- a/bootstrap/linux-9.2.8.json +++ b/bootstrap/linux-9.2.8.json @@ -154,7 +154,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": "6def2e07c317f52f4d30c43e92f97b7bc5f7c27cb1270d386b15dce429e1180f", @@ -178,7 +178,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -188,7 +188,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17" + "version": "3.16" }, { "cabal_sha256": "725ef6da03d3d6e332db4de0a35bee45d72e4d31decc5ec7f153e6837af5f03e", @@ -361,7 +361,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": "0e9de2ccce261e7a5b027e842f6f47f50eb0e6059a0de98a5479f75aa8164107", @@ -538,7 +538,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -552,7 +552,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" } ] } diff --git a/bootstrap/linux-9.4.8.json b/bootstrap/linux-9.4.8.json index aa2b1cfc1c0..6869426d49f 100644 --- a/bootstrap/linux-9.4.8.json +++ b/bootstrap/linux-9.4.8.json @@ -154,7 +154,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": "6def2e07c317f52f4d30c43e92f97b7bc5f7c27cb1270d386b15dce429e1180f", @@ -178,7 +178,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -188,7 +188,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17" + "version": "3.16" }, { "cabal_sha256": "725ef6da03d3d6e332db4de0a35bee45d72e4d31decc5ec7f153e6837af5f03e", @@ -351,7 +351,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": "0e9de2ccce261e7a5b027e842f6f47f50eb0e6059a0de98a5479f75aa8164107", @@ -528,7 +528,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -542,7 +542,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" } ] } diff --git a/bootstrap/linux-9.6.7.json b/bootstrap/linux-9.6.7.json index 21206ba8560..d4f4f3d2ae6 100644 --- a/bootstrap/linux-9.6.7.json +++ b/bootstrap/linux-9.6.7.json @@ -112,7 +112,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -124,7 +124,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -134,7 +134,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17" + "version": "3.16" }, { "cabal_sha256": "725ef6da03d3d6e332db4de0a35bee45d72e4d31decc5ec7f153e6837af5f03e", @@ -306,7 +306,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": "0e9de2ccce261e7a5b027e842f6f47f50eb0e6059a0de98a5479f75aa8164107", @@ -495,7 +495,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -509,7 +509,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" } ] } diff --git a/bootstrap/linux-9.8.4.json b/bootstrap/linux-9.8.4.json index c21b5a2fe0a..4f078a85f24 100644 --- a/bootstrap/linux-9.8.4.json +++ b/bootstrap/linux-9.8.4.json @@ -116,7 +116,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -128,7 +128,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -138,7 +138,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17" + "version": "3.16" }, { "cabal_sha256": "725ef6da03d3d6e332db4de0a35bee45d72e4d31decc5ec7f153e6837af5f03e", @@ -310,7 +310,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": "0e9de2ccce261e7a5b027e842f6f47f50eb0e6059a0de98a5479f75aa8164107", @@ -489,7 +489,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" }, { "cabal_sha256": null, @@ -503,7 +503,7 @@ "revision": null, "source": "local", "src_sha256": null, - "version": "3.17.0.0" + "version": "3.16.0.0" } ] } diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index 7e4386b149f..385bf277c99 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -1,6 +1,6 @@ cabal-version: 3.6 name: cabal-install-solver -version: 3.17.0.0 +version: 3.16.0.0 synopsis: The solver component of cabal-install description: The solver component used in the cabal-install command-line program. @@ -101,8 +101,8 @@ library , array >=0.4 && <0.6 , base >=4.13 && <4.22 , bytestring >=0.10.6.0 && <0.13 - , Cabal ^>=3.17 - , Cabal-syntax ^>=3.17 + , Cabal ^>=3.16 + , Cabal-syntax ^>=3.16 , containers >=0.5.6.2 && <0.9 , edit-distance ^>= 0.2.2 , directory >= 1.3.7.0 && < 1.4 diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index e511f37367a..bc10c7047d9 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -1,7 +1,7 @@ Cabal-Version: 3.6 Name: cabal-install -Version: 3.17.0.0 +Version: 3.16.0.0 Synopsis: The command-line interface for Cabal and Hackage. Description: The \'cabal\' command-line program simplifies the process of managing @@ -62,15 +62,15 @@ common base-dep common cabal-dep build-depends: - , Cabal ^>=3.17 + , Cabal ^>=3.16 common cabal-syntax-dep build-depends: - , Cabal-syntax ^>=3.17 + , Cabal-syntax ^>=3.16 common cabal-install-solver-dep build-depends: - , cabal-install-solver ^>=3.17 + , cabal-install-solver ^>=3.16 library import: warnings, base-dep, cabal-dep, cabal-syntax-dep, cabal-install-solver-dep diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index 1e5cd30d47c..15121702b66 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -28,7 +28,7 @@ common shared build-depends: , base >= 4.11 && < 4.22 -- this needs to match the in-tree lib:Cabal version - , Cabal ^>= 3.17.0.0 + , Cabal ^>= 3.16.0.0 ghc-options: -Wall diff --git a/doc/conf.py b/doc/conf.py index 9f17ba5766c..9915514c452 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -13,7 +13,7 @@ sys.path.insert(0, os.path.abspath('.')) import cabaldomain -version = "3.15.0.0" +version = "3.16.0.0" extensions = [ 'sphinx.ext.extlinks', diff --git a/solver-benchmarks/solver-benchmarks.cabal b/solver-benchmarks/solver-benchmarks.cabal index f3533e26f9a..f85db663ffe 100644 --- a/solver-benchmarks/solver-benchmarks.cabal +++ b/solver-benchmarks/solver-benchmarks.cabal @@ -31,7 +31,7 @@ library , base , bytestring , containers - , Cabal-syntax ^>= 3.17 + , Cabal-syntax ^>= 3.16 , directory , filepath , optparse-applicative From 97cafa688e33b7026d1b14ecd1762e42bcba8dfe Mon Sep 17 00:00:00 2001 From: Benjamin McRae Date: Wed, 25 Jun 2025 10:17:41 +0100 Subject: [PATCH 02/14] add paragraph mentioning stackage (cherry picked from commit 34e7e62588fad4cc2f612aa97606cae3fe7b0f14) --- doc/cabal-project-description-file.rst | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/cabal-project-description-file.rst b/doc/cabal-project-description-file.rst index b8dab19a5d5..de4c42217dd 100644 --- a/doc/cabal-project-description-file.rst +++ b/doc/cabal-project-description-file.rst @@ -85,6 +85,13 @@ architecture and version information from, which will force some commands (update, sdist) to require ghc present where otherwise it would not be necessitated. +One use case for imports is to specify a `Stackage ` +snapshot, so that your cabal project can use the same set of packages as +that snapshot. To use the ``lts-21.25`` resolver, you can write +``import: https://www.stackage.org/lts-21.25/cabal.config`` in your +``cabal.project``. Note that Stackage does not guarantee that these will work +with regards to revisions. + Specifying the local packages ----------------------------- From 370f7cd8b3ffd0da33429666fb3921a580f19317 Mon Sep 17 00:00:00 2001 From: Benjamin McRae Date: Wed, 25 Jun 2025 17:25:21 +0100 Subject: [PATCH 03/14] add some discussion of import config limitations (cherry picked from commit d2db2d0a0ab428398e3b7c63e5ab80b98d19ae6d) --- doc/cabal-project-description-file.rst | 7 +++++-- doc/nix-local-build.rst | 13 +++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/doc/cabal-project-description-file.rst b/doc/cabal-project-description-file.rst index de4c42217dd..7b9bd5d5241 100644 --- a/doc/cabal-project-description-file.rst +++ b/doc/cabal-project-description-file.rst @@ -89,8 +89,11 @@ One use case for imports is to specify a `Stackage ` snapshot, so that your cabal project can use the same set of packages as that snapshot. To use the ``lts-21.25`` resolver, you can write ``import: https://www.stackage.org/lts-21.25/cabal.config`` in your -``cabal.project``. Note that Stackage does not guarantee that these will work -with regards to revisions. +``cabal.project``. + +There are a number of limitations that come with this approach however; please +see :ref:`How can I have a reproducible set of versions for my dependencies?` for +more information. Specifying the local packages ----------------------------- diff --git a/doc/nix-local-build.rst b/doc/nix-local-build.rst index 6144cea85ba..f4532b29c1a 100644 --- a/doc/nix-local-build.rst +++ b/doc/nix-local-build.rst @@ -104,6 +104,8 @@ for each package using :cfg-field:`profiling-detail`:: Alternately, you can call ``cabal build --enable-profiling`` to temporarily build with profiling. +.. _how reproducible: + How can I have a reproducible set of versions for my dependencies? ------------------------------------------------------------------ @@ -134,6 +136,17 @@ development environments. .. _Stackage: https://stackage.org/ .. _versions of packages in lts-19.2: https://www.stackage.org/lts-19.2 +Limitations +^^^^^^^^^^^ + +Stackage does not guarantee that the config files will work with revisions, and +it's not currently possible to `override used versions of packages ` +or to `specify revisions ` using +cabal. + +To mitigate these shortcomings, you can download the config file that is linked +to and remove the troublesome constraints. + How it works ============ From 17a22b5ac459f97c5d2b1a992b11256131690b9a Mon Sep 17 00:00:00 2001 From: Benjamin <10566848+L0neGamer@users.noreply.github.com> Date: Wed, 2 Jul 2025 16:35:40 +0100 Subject: [PATCH 04/14] Update doc/nix-local-build.rst Co-authored-by: Phil de Joux (cherry picked from commit 0436a815862751b6205f8f756af80e7f174fe092) --- doc/nix-local-build.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/nix-local-build.rst b/doc/nix-local-build.rst index f4532b29c1a..312778f8d47 100644 --- a/doc/nix-local-build.rst +++ b/doc/nix-local-build.rst @@ -144,8 +144,7 @@ it's not currently possible to `override used versions of packages ` using cabal. -To mitigate these shortcomings, you can download the config file that is linked -to and remove the troublesome constraints. +To mitigate these shortcomings, download the linked ``cabal.config`` file, import this locally with a relative path and repeatedly ``cabal build all --dry-run`` to identify and then comment out version constraint conflicts until the cabal solver is happy. How it works ============ From 8b695175ef4bd69f78b105c7f956178dd1d644b1 Mon Sep 17 00:00:00 2001 From: ffaf1 Date: Tue, 8 Jul 2025 21:48:01 +0200 Subject: [PATCH 05/14] Add 3.16 changelogs (#11033) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add changelog files for 3.16 * Integrate Brandon’s suggestions. * Integrate Brandon’s suggestions /II. * Integrate Bodigrim’s suggestions. * Integrate Artem’s suggestions. * Correctly capitalize “AArch” in preparation of #11047 backport * Integrate Artem’s suggestions /II. * Remove changelog.d bits --- Cabal-hooks/CHANGELOG.md | 3 + Cabal-syntax/ChangeLog.md | 2 +- Cabal/ChangeLog.md | 3 + cabal-install-solver/ChangeLog.md | 2 +- cabal-install/ChangeLog.md | 4 + changelog.d/issue-9115.md | 26 --- changelog.d/issue-9694 | 4 - changelog.d/pr-10190 | 11 - changelog.d/pr-10254 | 16 -- changelog.d/pr-10273 | 19 -- changelog.d/pr-10356 | 11 - changelog.d/pr-10432 | 10 - changelog.d/pr-10525 | 34 --- changelog.d/pr-10549 | 11 - changelog.d/pr-10587 | 12 - changelog.d/pr-10590 | 14 -- changelog.d/pr-10629 | 13 -- changelog.d/pr-10637 | 11 - changelog.d/pr-10644.md | 165 ------------- changelog.d/pr-10646.md | 209 ----------------- changelog.d/pr-10647 | 10 - changelog.d/pr-10705 | 8 - changelog.d/pr-10805.md | 17 -- changelog.d/pr-10816.md | 23 -- changelog.d/pr-10817 | 12 - changelog.d/pr-10828.md | 15 -- changelog.d/pr-10830.md | 10 - changelog.d/pr-10840.md | 28 --- changelog.d/pr-10844.md | 14 -- changelog.d/pr-10880.md | 12 - changelog.d/pr-10908.md | 8 - changelog.d/pr-10912.md | 8 - changelog.d/pr-10936.md | 6 - changelog.d/pr-10940 | 17 -- changelog.d/pr-10941 | 8 - changelog.d/pr-10948.md | 18 -- changelog.d/pr-10949.md | 13 -- changelog.d/pr-10966.md | 20 -- changelog.d/pr-10967.md | 13 -- changelog.d/pr-10979 | 8 - changelog.d/pr-10991.md | 15 -- changelog.d/pr-10992.md | 11 - changelog.d/pr-11003.md | 8 - changelog.d/pr-11014 | 9 - changelog.d/pr-9367 | 21 -- changelog.d/pr-9744.md | 18 -- changelog.d/pr-9890 | 10 - release-notes/Cabal-3.16.0.0.md | 199 ++++++++++++++++ release-notes/WIP-Cabal-3.16.x.0.md | 18 -- release-notes/cabal-install-3.16.0.0.md | 292 ++++++++++++++++++++++++ 50 files changed, 503 insertions(+), 946 deletions(-) delete mode 100644 changelog.d/issue-9115.md delete mode 100644 changelog.d/issue-9694 delete mode 100644 changelog.d/pr-10190 delete mode 100644 changelog.d/pr-10254 delete mode 100644 changelog.d/pr-10273 delete mode 100644 changelog.d/pr-10356 delete mode 100644 changelog.d/pr-10432 delete mode 100644 changelog.d/pr-10525 delete mode 100644 changelog.d/pr-10549 delete mode 100644 changelog.d/pr-10587 delete mode 100644 changelog.d/pr-10590 delete mode 100644 changelog.d/pr-10629 delete mode 100644 changelog.d/pr-10637 delete mode 100644 changelog.d/pr-10644.md delete mode 100644 changelog.d/pr-10646.md delete mode 100644 changelog.d/pr-10647 delete mode 100644 changelog.d/pr-10705 delete mode 100644 changelog.d/pr-10805.md delete mode 100644 changelog.d/pr-10816.md delete mode 100644 changelog.d/pr-10817 delete mode 100644 changelog.d/pr-10828.md delete mode 100644 changelog.d/pr-10830.md delete mode 100644 changelog.d/pr-10840.md delete mode 100644 changelog.d/pr-10844.md delete mode 100644 changelog.d/pr-10880.md delete mode 100644 changelog.d/pr-10908.md delete mode 100644 changelog.d/pr-10912.md delete mode 100644 changelog.d/pr-10936.md delete mode 100644 changelog.d/pr-10940 delete mode 100644 changelog.d/pr-10941 delete mode 100644 changelog.d/pr-10948.md delete mode 100644 changelog.d/pr-10949.md delete mode 100644 changelog.d/pr-10966.md delete mode 100644 changelog.d/pr-10967.md delete mode 100644 changelog.d/pr-10979 delete mode 100644 changelog.d/pr-10991.md delete mode 100644 changelog.d/pr-10992.md delete mode 100644 changelog.d/pr-11003.md delete mode 100644 changelog.d/pr-11014 delete mode 100644 changelog.d/pr-9367 delete mode 100644 changelog.d/pr-9744.md delete mode 100644 changelog.d/pr-9890 create mode 100644 release-notes/Cabal-3.16.0.0.md delete mode 100644 release-notes/WIP-Cabal-3.16.x.0.md create mode 100644 release-notes/cabal-install-3.16.0.0.md 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. From a9dd5aa29aa43cd9a1011989b31c241d7a943148 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Sun, 6 Jul 2025 09:40:02 +0200 Subject: [PATCH 06/14] =?UTF-8?q?Capitalise=20=E2=80=9CAArch=E2=80=9D=20pr?= =?UTF-8?q?operly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The official capitalisation is “AArch”, see https://developer.arm.com/documentation/102374/latest/. --- Cabal/src/Distribution/Simple/Build/PathsModule.hs | 2 +- Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs | 6 +++--- cabal-dev-scripts/src/GenPathsModule.hs | 2 +- templates/Paths_pkg.template.hs | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cabal/src/Distribution/Simple/Build/PathsModule.hs b/Cabal/src/Distribution/Simple/Build/PathsModule.hs index dc8348f6396..9392acf3cef 100644 --- a/Cabal/src/Distribution/Simple/Build/PathsModule.hs +++ b/Cabal/src/Distribution/Simple/Build/PathsModule.hs @@ -51,7 +51,7 @@ generatePathsModule pkg_descr lbi clbi = , Z.zIsWindows = isWindows , Z.zIsI386 = buildArch == I386 , Z.zIsX8664 = buildArch == X86_64 - , Z.zIsAarch64 = buildArch == AArch64 + , Z.zIsAArch64 = buildArch == AArch64 , Z.zNot = not , Z.zManglePkgName = showPkgName , Z.zPrefix = show flat_prefix diff --git a/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs b/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs index c0a40f55bac..8f33717bbda 100644 --- a/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs +++ b/Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs @@ -12,7 +12,7 @@ data Z zIsWindows :: Bool, zIsI386 :: Bool, zIsX8664 :: Bool, - zIsAarch64 :: Bool, + zIsAArch64 :: Bool, zPrefix :: FilePath, zBindir :: FilePath, zLibdir :: FilePath, @@ -350,13 +350,13 @@ render z_root = execWriter $ do tell " c_GetModuleFileName :: Ptr () -> CWString -> Int32 -> IO Int32\n" return () else do - if (zIsAarch64 z_root) + if (zIsAArch64 z_root) then do tell "foreign import ccall unsafe \"windows.h GetModuleFileNameW\"\n" tell " c_GetModuleFileName :: Ptr () -> CWString -> Int32 -> IO Int32\n" return () else do - tell "-- win32 supported only with I386, X86_64, Aarch64\n" + tell "-- win32 supported only with I386, X86_64, AArch64\n" tell "c_GetModuleFileName :: Ptr () -> CWString -> Int32 -> IO Int32\n" tell "c_GetModuleFileName = _\n" return () diff --git a/cabal-dev-scripts/src/GenPathsModule.hs b/cabal-dev-scripts/src/GenPathsModule.hs index ca7380c74df..7c5c947a5b7 100644 --- a/cabal-dev-scripts/src/GenPathsModule.hs +++ b/cabal-dev-scripts/src/GenPathsModule.hs @@ -32,7 +32,7 @@ $(capture "decls" [d| , zIsWindows :: Bool , zIsI386 :: Bool , zIsX8664 :: Bool - , zIsAarch64 :: Bool + , zIsAArch64 :: Bool , zPrefix :: FilePath , zBindir :: FilePath diff --git a/templates/Paths_pkg.template.hs b/templates/Paths_pkg.template.hs index faa497c0b3b..a9b02b0ef64 100644 --- a/templates/Paths_pkg.template.hs +++ b/templates/Paths_pkg.template.hs @@ -205,11 +205,11 @@ foreign import stdcall unsafe "windows.h GetModuleFileNameW" {% elif isX8664 %} foreign import ccall unsafe "windows.h GetModuleFileNameW" c_GetModuleFileName :: Ptr () -> CWString -> Int32 -> IO Int32 -{% elif isAarch64 %} +{% elif isAArch64 %} foreign import ccall unsafe "windows.h GetModuleFileNameW" c_GetModuleFileName :: Ptr () -> CWString -> Int32 -> IO Int32 {% else %} --- win32 supported only with I386, X86_64, Aarch64 +-- win32 supported only with I386, X86_64, AArch64 c_GetModuleFileName :: Ptr () -> CWString -> Int32 -> IO Int32 c_GetModuleFileName = _ {% endif %} From 5fd777a28a7c89d750a41e8937f5fe399ca24c5c Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Wed, 2 Jul 2025 10:06:17 +0100 Subject: [PATCH 07/14] release: Bump boot compiler for release to 9.10.2 Also bumps the cabal-install used during the release process to 3.14.2.0. (cherry picked from commit e7272999e85657737e4df84ba7206e4660309317) --- .github/workflows/validate.yml | 8 ++++---- .gitlab-ci.yml | 7 ++----- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 70bb0c8a6dd..abf19bffab8 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -32,10 +32,10 @@ on: env: # We choose a stable ghc version across all os's # which will be used to do the next release - GHC_FOR_RELEASE: "9.4.8" + GHC_FOR_RELEASE: "9.10.2" # Ideally we should use the version about to be released for hackage tests and benchmarks - GHC_FOR_SOLVER_BENCHMARKS: "9.4.8" - GHC_FOR_COMPLETE_HACKAGE_TESTS: "9.4.8" + GHC_FOR_SOLVER_BENCHMARKS: "9.10.2" + GHC_FOR_COMPLETE_HACKAGE_TESTS: "9.10.2" COMMON_FLAGS: "-j 2 -v" # See https://github.com/haskell/cabal/blob/master/CONTRIBUTING.md#hackage-revisions @@ -61,7 +61,7 @@ jobs: ghc: [ "9.12.2", - "9.10.1", + "9.10.2", "9.8.4", "9.6.7", "9.4.8", diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 87b6d0de22a..70dda50b46b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,8 @@ variables: # Commit of ghc/ci-images repository from which to pull Docker images DOCKER_REV: "a9297a370025101b479cfd4977f8f910814e03ab" - GHC_VERSION: 9.6.4 - CABAL_INSTALL_VERSION: 3.10.2.0 + GHC_VERSION: 9.10.2 + CABAL_INSTALL_VERSION: 3.14.2.0 workflow: rules: @@ -110,9 +110,6 @@ darwin: tags: - ${ARCH}-darwin-m1 variables: - # Using 9.8.2 to work around - # https://gitlab.haskell.org/ghc/ghc/-/issues/24050 - GHC_VERSION: 9.8.2 TARBALL_ARCHIVE_SUFFIX: ${ARCH}-darwin TARBALL_EXT: tar.xz ADD_CABAL_ARGS: "" From 8e424ff473f4182d60a8e41add6d46692833c0cb Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Wed, 2 Jul 2025 10:16:19 +0100 Subject: [PATCH 08/14] Update platforms for release jobs * Drop deb9, ubuntu18 and centos7 jobs which are all EOL * Add ubuntu24_04 * Build a very old alpine bindist (3.12) and a new one (3.20) * Only build 3_20 bindist for alpine i386. The list of release platforms after this commit is Linux * x86_64 - deb10 - deb11 - deb12 - fedora33 - fedora36 - fedora38 - rocky8 - ubuntu20_04 - ubuntu22_04 - ubuntu24_04 - alpine3_12 - alpine3_20 * i386 - deb10 - alpine3_20 * aarch64 - deb10 - deb11 - deb12 - alpine3_18 Darwin * x86_64 * aarch64 Windows * x86_64 (cherry picked from commit 976e0f98432825b6ed6d20a97b837ed711b89477) --- .gitlab-ci.yml | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 70dda50b46b..4657457baad 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,7 +3,7 @@ stages: variables: # Commit of ghc/ci-images repository from which to pull Docker images - DOCKER_REV: "a9297a370025101b479cfd4977f8f910814e03ab" + DOCKER_REV: "df20b2eb2fcc1c93aed5ad047c65752fbd4c38d4" GHC_VERSION: 9.10.2 CABAL_INSTALL_VERSION: 3.14.2.0 @@ -33,12 +33,10 @@ linux: - ARCH: i386 TAG: x86_64-linux OS: - - deb9 - deb10 - ARCH: x86_64 TAG: x86_64-linux OS: - - deb9 - deb10 - deb11 - deb12 @@ -46,17 +44,9 @@ linux: - fedora36 - fedora38 - rocky8 - - ubuntu18_04 - ubuntu20_04 - ubuntu22_04 - # Pull this one from the future, since it's missing. - # We can't move the entire file to this DOCKER_REV, because - # i386-linux-deb9 is missing from it. - - ARCH: x86_64 - TAG: x86_64-linux - OS: centos7 - DOCKER_REV: f2d12519f45a13a61fcca03a949f927ceead6492 - + - ubuntu24_04 - ARCH: aarch64 TAG: aarch64-linux OS: @@ -76,12 +66,11 @@ alpine-linux: extends: .build parallel: matrix: - - ARCH: [i386, x86_64] - OS: [alpine3_12, alpine3_15, alpine3_17] + - ARCH: [x86_64] + OS: [alpine3_12, alpine3_20] TAG: x86_64-linux - # Was 3_18 for i386 intentionally left off? - - ARCH: x86_64 - OS: alpine3_18 + - ARCH: [i386] + OS: alpine3_20 TAG: x86_64-linux - ARCH: [aarch64] OS: [alpine3_18] From ded7ceb5ccbba4957b94b312168ed9208f45dc4f Mon Sep 17 00:00:00 2001 From: Matthew Pickering Date: Wed, 2 Jul 2025 10:29:08 +0100 Subject: [PATCH 09/14] Check the GHC and cabal-install version which are used to build the release (cherry picked from commit ca7a9387e27e7c540169ef81d9ce7ad158d5d036) --- .gitlab/ci.sh | 72 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 61 insertions(+), 11 deletions(-) diff --git a/.gitlab/ci.sh b/.gitlab/ci.sh index 94abd39cdf9..708ff0e0d30 100755 --- a/.gitlab/ci.sh +++ b/.gitlab/ci.sh @@ -4,20 +4,70 @@ set -Eeuo pipefail source "$CI_PROJECT_DIR/.gitlab/common.sh" -## Figure out how to get the Haskell toolchain. - -# For backport, the centos image no longer has the right GHC version, so use -# ghcup. -if [[ -f /etc/os-release && "$(grep ^ID /etc/os-release)" =~ "centos" ]]; then - . "$CI_PROJECT_DIR/.gitlab/ghcup.sh" -# All the other ones are fine. -elif [[ "$(uname)" == "Linux" ]]; then - export PATH="/opt/ghc/${GHC_VERSION}/bin:${PATH}" -# Not all runners use ci-images, so ghcup is used. +# Required arguments to the script +: "${GHC_VERSION:?Need to set GHC_VERSION}" +: "${CABAL_INSTALL_VERSION:?Need to set CABAL_INSTALL_VERSION}" + +# If GHC is set, extract its directory and add it to PATH +# The linux images set the GHC variable to specify the location of the GHC installation. +if [[ -n "${GHC:-}" ]]; then + echo "GHC variable is set to: $GHC" + export PATH="$(dirname "$GHC"):$PATH" +else + GHC="ghc" +fi + +echo "Checking toolchain versions..." + +# GHC check +ghc_version_ok=false +if command -v ghc &>/dev/null; then + current_ghc_version=$(ghc --numeric-version) + if [[ "$current_ghc_version" == "$GHC_VERSION" ]]; then + ghc_version_ok=true + else + echo "Wrong GHC version: found $current_ghc_version, expected $GHC_VERSION" + fi else - . "$CI_PROJECT_DIR/.gitlab/ghcup.sh" + echo "GHC executable '$GHC' not found on PATH" fi +# cabal check +cabal_version_ok=false +if command -v cabal &>/dev/null; then + current_cabal_version=$(cabal --numeric-version) + if [[ "$current_cabal_version" == "$CABAL_INSTALL_VERSION" ]]; then + cabal_version_ok=true + else + echo "Wrong cabal version: found $current_cabal_version, expected $CABAL_INSTALL_VERSION" + fi +else + echo "cabal not found on PATH" +fi + +# If either is wrong, install via ghcup +if ! $ghc_version_ok || ! $cabal_version_ok; then + echo "Installing correct GHC and/or cabal via ghcup..." + . "$CI_PROJECT_DIR/.gitlab/ghcup.sh" +fi + +# Final verification (ghc and cabal must now be on PATH) +echo "Verifying installed versions..." + +actual_ghc_version=$(ghc --numeric-version) +actual_cabal_version=$(cabal --numeric-version) + +if [[ "$actual_ghc_version" != "$GHC_VERSION" ]]; then + fail "Incorrect GHC version (actual: $actual_ghc_version, expected: $GHC_VERSION)" +fi + +if [[ "$actual_cabal_version" != "$CABAL_INSTALL_VERSION" ]]; then + fail "Incorrect cabal version (actual: $actual_cabal_version, expected: $CABAL_INSTALL_VERSION)" +fi + +echo "Using GHC version: $actual_ghc_version" +echo "Using cabal-install version: $actual_cabal_version" + export CABAL_DIR="$CI_PROJECT_DIR/cabal" case "$(uname)" in From 651120c958f8dd6ec63f4717f9a7e2e868ba5a64 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 13:09:00 +0000 Subject: [PATCH 10/14] Backport #11061: missed updating all the copyrights in the cabal files (#11063) * missed all the copyrights in the cabal files (cherry picked from commit 7f494c235df2484edf071364e04fc4e0e9804bbc) # Conflicts: # Cabal-hooks/Cabal-hooks.cabal # Cabal-syntax/Cabal-syntax.cabal # Cabal/Cabal.cabal * Update Cabal-hooks/Cabal-hooks.cabal * Update Cabal-syntax/Cabal-syntax.cabal * Update Cabal/Cabal.cabal --------- Co-authored-by: brandon s allbery kf8nh Co-authored-by: Mikolaj Konarski --- Cabal-hooks/Cabal-hooks.cabal | 2 +- Cabal-syntax/Cabal-syntax.cabal | 2 +- Cabal-tests/Cabal-tests.cabal | 2 +- Cabal/Cabal.cabal | 2 +- cabal-benchmarks/cabal-benchmarks.cabal | 2 +- cabal-install-solver/cabal-install-solver.cabal | 2 +- cabal-install/cabal-install.cabal | 2 +- cabal-testsuite/cabal-testsuite.cabal | 2 +- cabal-validate/cabal-validate.cabal | 2 +- solver-benchmarks/solver-benchmarks.cabal | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cabal-hooks/Cabal-hooks.cabal b/Cabal-hooks/Cabal-hooks.cabal index 1c7d079d223..155d98cf757 100644 --- a/Cabal-hooks/Cabal-hooks.cabal +++ b/Cabal-hooks/Cabal-hooks.cabal @@ -1,7 +1,7 @@ cabal-version: 3.6 name: Cabal-hooks version: 3.16 -copyright: 2023, Cabal Development Team +copyright: 2025, Cabal Development Team license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team diff --git a/Cabal-syntax/Cabal-syntax.cabal b/Cabal-syntax/Cabal-syntax.cabal index d1fcf526063..42fc9248b3d 100644 --- a/Cabal-syntax/Cabal-syntax.cabal +++ b/Cabal-syntax/Cabal-syntax.cabal @@ -1,7 +1,7 @@ cabal-version: 3.6 name: Cabal-syntax version: 3.16.0.0 -copyright: 2003-2024, Cabal Development Team (see AUTHORS file) +copyright: 2003-2025, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team diff --git a/Cabal-tests/Cabal-tests.cabal b/Cabal-tests/Cabal-tests.cabal index ad9bf16cf46..f8d06955d71 100644 --- a/Cabal-tests/Cabal-tests.cabal +++ b/Cabal-tests/Cabal-tests.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: Cabal-tests version: 3 -copyright: 2003-2024, Cabal Development Team (see AUTHORS file) +copyright: 2003-2025, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team diff --git a/Cabal/Cabal.cabal b/Cabal/Cabal.cabal index 8ebff8a642e..517677e99df 100644 --- a/Cabal/Cabal.cabal +++ b/Cabal/Cabal.cabal @@ -1,7 +1,7 @@ cabal-version: 3.6 name: Cabal version: 3.16.0.0 -copyright: 2003-2024, Cabal Development Team (see AUTHORS file) +copyright: 2003-2025, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team diff --git a/cabal-benchmarks/cabal-benchmarks.cabal b/cabal-benchmarks/cabal-benchmarks.cabal index ade0fa3b178..a48e9298677 100644 --- a/cabal-benchmarks/cabal-benchmarks.cabal +++ b/cabal-benchmarks/cabal-benchmarks.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: cabal-benchmarks version: 3 -copyright: 2003-2024, Cabal Development Team (see AUTHORS file) +copyright: 2003-2025, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index 385bf277c99..51456623839 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -11,7 +11,7 @@ license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team (see AUTHORS file) maintainer: Cabal Development Team -copyright: 2003-2024, Cabal Development Team +copyright: 2003-2025, Cabal Development Team category: Distribution build-type: Simple extra-doc-files: diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index bc10c7047d9..81976b09d97 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -13,7 +13,7 @@ License: BSD-3-Clause License-File: LICENSE Author: Cabal Development Team (see AUTHORS file) Maintainer: Cabal Development Team -Copyright: 2003-2024, Cabal Development Team +Copyright: 2003-2025, Cabal Development Team Category: Distribution Build-type: Simple Extra-Source-Files: diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index 15121702b66..4c76c66ae02 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: cabal-testsuite version: 3 -copyright: 2003-2024, Cabal Development Team (see AUTHORS file) +copyright: 2003-2025, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team diff --git a/cabal-validate/cabal-validate.cabal b/cabal-validate/cabal-validate.cabal index 582cf67434a..0f784898ff9 100644 --- a/cabal-validate/cabal-validate.cabal +++ b/cabal-validate/cabal-validate.cabal @@ -1,7 +1,7 @@ cabal-version: 3.0 name: cabal-validate version: 1.0.0 -copyright: 2024-2024, Cabal Development Team (see AUTHORS file) +copyright: 2024-2025, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause author: Cabal Development Team synopsis: An internal tool for building and testing the Cabal package manager diff --git a/solver-benchmarks/solver-benchmarks.cabal b/solver-benchmarks/solver-benchmarks.cabal index f85db663ffe..a0cec95d38d 100644 --- a/solver-benchmarks/solver-benchmarks.cabal +++ b/solver-benchmarks/solver-benchmarks.cabal @@ -1,7 +1,7 @@ cabal-version: 2.2 name: solver-benchmarks version: 3 -copyright: 2003-2024, Cabal Development Team (see AUTHORS file) +copyright: 2003-2025, Cabal Development Team (see AUTHORS file) license: BSD-3-Clause license-file: LICENSE author: Cabal Development Team From 01b8c86fae36820b92818a2af5a5ab56dbee0e9d Mon Sep 17 00:00:00 2001 From: fendor Date: Thu, 24 Jul 2025 14:46:48 +0200 Subject: [PATCH 11/14] Always pass '--interactive' as the first ghc argument We recently changed Cabal to use response files for all GHC arguments by default. Unfortunately, this broke a couple of downstream consumers of cabal, notably Haskell Language Server and doctest, which both assume that `--interactive` is the first argument of the `ghc` invocation by `cabal repl`. This regression was fixed by implementing the `--with-repl` (#9115) argument, and tools, such as hie-bios and doctest, have been updated to take advantage of this. However, this renders already published HLS binaries, so any HLS version <=2.12.0.0, incompatible with `cabal-3.16`, as these old binaries can't be easily updated. In other words, no released HLS binary (at the point of this commit), is compatible with the cabal-3.16.0.0. Users have to build HLS from source to have a working toolchain. To give us a slightly better migration window, we undo some of the improvements to cabal, and make sure that `--interactive` is always passed as the first argument to the underlying `ghc` invocation. This hack is supposed to be temporary, and removed for cabal 3.18. Further, we don't use response files for the final `ghc --interactive` invocation. --- Cabal/src/Distribution/Simple/Program/GHC.hs | 32 ++++++++++++++- .../src/Distribution/Client/CmdRepl.hs | 3 +- .../WithRepl/InteractiveIsFirstTest/Main.hs | 5 +++ .../cabal-with-repl-exe.cabal | 21 ++++++++++ .../InteractiveIsFirstTest/cabal.project | 1 + .../InteractiveIsFirstTest/cabal.test.hs | 39 +++++++++++++++++++ .../InteractiveIsFirstTest/source1/Lib1.hs | 4 ++ .../InteractiveIsFirstTest/source2/Lib2.hs | 4 ++ changelog.d/pr-11101 | 14 +++++++ 9 files changed, 120 insertions(+), 3 deletions(-) create mode 100644 cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/Main.hs create mode 100644 cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal-with-repl-exe.cabal create mode 100644 cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal.project create mode 100644 cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal.test.hs create mode 100644 cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/source1/Lib1.hs create mode 100644 cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/source2/Lib2.hs create mode 100644 changelog.d/pr-11101 diff --git a/Cabal/src/Distribution/Simple/Program/GHC.hs b/Cabal/src/Distribution/Simple/Program/GHC.hs index 17bc27f151c..557ecf07e67 100644 --- a/Cabal/src/Distribution/Simple/Program/GHC.hs +++ b/Cabal/src/Distribution/Simple/Program/GHC.hs @@ -692,6 +692,22 @@ runGHCWithResponseFile fileNameTemplate encoding tempFileOptions verbosity ghcPr runProgramInvocation verbosity newInvocation +-- Note [Make --interactive the first argument to GHC] +-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +-- The ghc argument @--interactive@ needs to be the first argument to the +-- ghc invocation, because Haskell Language Server used to rely on this. +-- This was initially changed for Cabal 3.16, but it broke all existing Haskell +-- Language Server prebuilt binaries. +-- To avoid this, we uphold this assumption in Haskell Language Server until the next +-- Cabal release (3.18). +-- +-- The solution is to make sure that @--interactive@ is not passed as an argument in +-- the response file that is usually passed to ghc. +-- Instead, we filter out @--interactive@ and always pass it as the first argument, +-- if it exists. +-- +-- We plan to remove this Hack in Cabal 3.18. + -- Start the repl. Either use `ghc`, or the program specified by the --with-repl flag. runReplProgram :: Maybe FilePath @@ -704,11 +720,23 @@ runReplProgram -> Maybe (SymbolicPath CWD (Dir Pkg)) -> GhcOptions -> IO () -runReplProgram withReplProg tempFileOptions verbosity ghcProg comp platform mbWorkDir ghcOpts = +runReplProgram withReplProg _tempFileOptions verbosity ghcProg comp platform mbWorkDir ghcOpts = let replProg = case withReplProg of Just path -> ghcProg{programLocation = FoundOnSystem path} Nothing -> ghcProg - in runGHCWithResponseFile "ghci.rsp" Nothing tempFileOptions verbosity replProg comp platform mbWorkDir ghcOpts + in do + -- in runGHCWithResponseFile "ghci.rsp" Nothing tempFileOptions verbosity replProg comp platform mbWorkDir ghcOpts + -- See Note [Make --interactive the first argument to GHC] + -- In Cabal 3.18, restore the line above. + invocation <- ghcInvocation verbosity replProg comp platform mbWorkDir ghcOpts + let invocation' = + let + argsWithoutInteractive = filter (/= "--interactive") (progInvokeArgs invocation) + in + invocation + { progInvokeArgs = ["--interactive"] <> argsWithoutInteractive + } + runProgramInvocation verbosity invocation' ghcInvocation :: Verbosity diff --git a/cabal-install/src/Distribution/Client/CmdRepl.hs b/cabal-install/src/Distribution/Client/CmdRepl.hs index 7fb3f700d09..a42a2c74cee 100644 --- a/cabal-install/src/Distribution/Client/CmdRepl.hs +++ b/cabal-install/src/Distribution/Client/CmdRepl.hs @@ -481,7 +481,8 @@ replAction flags@NixStyleFlags{extraFlags = r@ReplFlags{..}, ..} targetStrings g unit_files_ordered :: [FilePath] unit_files_ordered = let (active_unit_files, other_units) = partition (\fp -> Just fp == active_unit_fp) unit_files - in -- GHC considers the last unit passed to be the active one + in -- older GHC versions consider the last unit passed to be the active one. + -- GHC 9.14 no longer has the notion of "active" units. other_units ++ active_unit_files convertParStrat :: ParStratX Int -> ParStratX String diff --git a/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/Main.hs b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/Main.hs new file mode 100644 index 00000000000..c6dc6ccb01e --- /dev/null +++ b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/Main.hs @@ -0,0 +1,5 @@ +import System.Environment +import Control.Monad + +main :: IO () +main = putStrLn . unwords =<< getArgs diff --git a/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal-with-repl-exe.cabal b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal-with-repl-exe.cabal new file mode 100644 index 00000000000..ab184798edb --- /dev/null +++ b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal-with-repl-exe.cabal @@ -0,0 +1,21 @@ +cabal-version: 2.4 +name: cabal-with-repl-exe +version: 0.1.0.0 +build-type: Simple + +executable test-exe + main-is: Main.hs + build-depends: base + default-language: Haskell2010 + +library internal1 + hs-source-dirs: source1 + build-depends: base + exposed-modules: Lib1 + default-language: Haskell2010 + +library internal2 + hs-source-dirs: source2 + build-depends: base + exposed-modules: Lib2 + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal.project b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal.project new file mode 100644 index 00000000000..e6fdbadb439 --- /dev/null +++ b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal.project @@ -0,0 +1 @@ +packages: . diff --git a/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal.test.hs b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal.test.hs new file mode 100644 index 00000000000..6c1168da813 --- /dev/null +++ b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/cabal.test.hs @@ -0,0 +1,39 @@ +{-# LANGUAGE OverloadedStrings #-} +import Distribution.Simple.Program +import Distribution.Simple.Program.GHC +import Distribution.Simple.Utils +import Test.Cabal.Prelude + +-- On windows this test passed but then fails in CI with +-- +-- D:\a\_temp\cabal-testsuite-12064\cabal-multi.dist\work\.\dist\multi-out-63884\paths\cabal-with-repl-exe-0.1.0.0-inplace-test-exe: removeDirectoryRecursive:removeContentsRecursive:removePathRecursive:removeContentsRecursive:removePathRecursive:DeleteFile "\\\\?\\D:\\a\\_temp\\cabal-testsuite-12064\\cabal-multi.dist\\work\\dist\\multi-out-63884\\paths\\cabal-with-repl-exe-0.1.0.0-inplace-test-exe": permission denied (The process cannot access the file because it is being used by another process.) +-- + +main = do + -- Test that '--with-repl' with one target lists '--interactive' as the first argument + -- This test should be deleted, once we reach Cabal 3.18, and enough HLS + -- binaries have been released that support response file syntax. + -- See Note [Make --interactive the first argument to GHC] + mkTest "repl-single-target" $ \exePath -> do + res <- cabalWithStdin "v2-repl" ["--with-repl=" ++ exePath, "test-exe"] "" + assertOutputMatches "^--interactive" res + mkTest "repl-multi-target" $ \exePath -> do + requireGhcSupportsMultiRepl + res <- cabalWithStdin "v2-repl" ["--enable-multi-repl", "--with-repl=" ++ exePath, "internal1", "internal2"] "" + assertOutputMatches "^--interactive" res + mkTest "repl-multi-target-all" $ \exePath -> do + requireGhcSupportsMultiRepl + res <- cabalWithStdin "v2-repl" ["--enable-multi-repl", "--with-repl=" ++ exePath, "all"] "" + assertOutputMatches "^--interactive" res + + +mkTest name act = do + skipIfCIAndWindows 11026 + cabalTest' name $ recordMode DoNotRecord $ do + -- Build the executable + cabal' "v2-build" ["test-exe"] + -- Get the path to the built executable + withPlan $ do + exePath <- planExePath "cabal-with-repl-exe" "test-exe" + act exePath + diff --git a/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/source1/Lib1.hs b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/source1/Lib1.hs new file mode 100644 index 00000000000..2ab07584f95 --- /dev/null +++ b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/source1/Lib1.hs @@ -0,0 +1,4 @@ +module Lib1 where + +y :: Int +y = 42 diff --git a/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/source2/Lib2.hs b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/source2/Lib2.hs new file mode 100644 index 00000000000..eb1f807739d --- /dev/null +++ b/cabal-testsuite/PackageTests/WithRepl/InteractiveIsFirstTest/source2/Lib2.hs @@ -0,0 +1,4 @@ +module Lib2 where + +x :: Int +x = 42 diff --git a/changelog.d/pr-11101 b/changelog.d/pr-11101 new file mode 100644 index 00000000000..7db667d5aaf --- /dev/null +++ b/changelog.d/pr-11101 @@ -0,0 +1,14 @@ +synopsis: Always pass '--interactive' as the first ghc argument +packages: Cabal +prs: #11101 +issues: #11099 +description: { +We recently changed Cabal to use response files for all GHC arguments by default. +Unfortunately, this broke a couple of downstream consumers of cabal, notably Haskell Language Server and doctest, which both assume that `--interactive` is the first argument of the `ghc` invocation by `cabal repl`. + +This regression was fixed by implementing the `--with-repl` (#9115) argument, and tools, such as hie-bios and doctest, have been updated to take advantage of this. However, this renders already published HLS binaries, so any HLS version <=2.12.0.0, incompatible with `cabal-3.16`, as these old binaries can't be easily updated. + +In other words, no released HLS binary (at the point of this commit), is compatible with the cabal-3.16.0.0. Users have to build HLS from source to have a working toolchain. + +To give us a slightly better migration window, we undo some of the improvements to cabal, and make sure that `--interactive` is always passed as the first argument to the underlying `ghc` invocation. This hack is supposed to be temporary, and removed for cabal 3.18. +} From 9883ab6ca4d9336ab5df1209720f7fe22cf28007 Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Mon, 4 Aug 2025 14:40:33 -0400 Subject: [PATCH 12/14] update `time` to 1.15 (cherry picked from commit 9d8968ed2f7c14fa574516de65678722b21cbc85) --- Cabal-syntax/Cabal-syntax.cabal | 2 +- Cabal/Cabal.cabal | 2 +- cabal-install/cabal-install.cabal | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cabal-syntax/Cabal-syntax.cabal b/Cabal-syntax/Cabal-syntax.cabal index 42fc9248b3d..2b8687098d7 100644 --- a/Cabal-syntax/Cabal-syntax.cabal +++ b/Cabal-syntax/Cabal-syntax.cabal @@ -40,7 +40,7 @@ library , parsec >= 3.1.13.0 && < 3.2 , pretty >= 1.1.1 && < 1.2 , text (>= 1.2.3.0 && < 1.3) || (>= 2.0 && < 2.2) - , time >= 1.4.0.1 && < 1.15 + , time >= 1.4.0.1 && < 1.16 -- transformers-0.4.0.0 doesn't have record syntax e.g. for Identity -- See also https://github.com/ekmett/transformers-compat/issues/35 , transformers (>= 0.3 && < 0.4) || (>=0.4.1.0 && <0.7) diff --git a/Cabal/Cabal.cabal b/Cabal/Cabal.cabal index 517677e99df..3fe4ce5ebe2 100644 --- a/Cabal/Cabal.cabal +++ b/Cabal/Cabal.cabal @@ -49,7 +49,7 @@ library , filepath >= 1.3.0.1 && < 1.6 , pretty >= 1.1.1 && < 1.2 , process >= 1.2.1.0 && < 1.7 - , time >= 1.4.0.1 && < 1.15 + , time >= 1.4.0.1 && < 1.16 if os(windows) build-depends: diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index 81976b09d97..b9fb2fb99e8 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -251,7 +251,7 @@ library , random >= 1.2 && < 1.4 , stm >= 2.0 && < 2.6 , tar >= 0.5.0.3 && < 0.7 - , time >= 1.5.0.1 && < 1.15 + , time >= 1.5.0.1 && < 1.16 , zlib >= 0.5.3 && < 0.8 , hackage-security >= 0.6.2.0 && < 0.7 , text >= 1.2.3 && < 1.3 || >= 2.0 && < 2.2 From dedbea4cd8b11e622476eba8bccb538faff958b3 Mon Sep 17 00:00:00 2001 From: brandon s allbery kf8nh Date: Fri, 3 Oct 2025 16:15:26 -0400 Subject: [PATCH 13/14] indicate which of the joined tests failed So people don't have to open all of the collapsed test output to find any failures. (cherry picked from commit e93d9c0b2969b8a22865390adaf9cb120329425a) --- .github/workflows/validate.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index abf19bffab8..13a77e74c97 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -234,6 +234,10 @@ jobs: echo Validate "$test" sh validate.sh $FLAGS -s "$test" || rc=1 echo End "$test" + echo ::endgroup:: + if [ $rc -eq 1 ]; then + echo Some tests failed + fi done exit $rc # The above ensures all the tests get run, for a single platform+ghc. From 44822bcf0b86cfb920b165a4233cb8cd56b825e6 Mon Sep 17 00:00:00 2001 From: Francesco Ariis Date: Sun, 9 Nov 2025 09:26:34 +0100 Subject: [PATCH 14/14] Bump QuickCheck --- Cabal-QuickCheck/Cabal-QuickCheck.cabal | 2 +- cabal-install/cabal-install.cabal | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cabal-QuickCheck/Cabal-QuickCheck.cabal b/Cabal-QuickCheck/Cabal-QuickCheck.cabal index 5d9d723b974..3a7ea4f91e8 100644 --- a/Cabal-QuickCheck/Cabal-QuickCheck.cabal +++ b/Cabal-QuickCheck/Cabal-QuickCheck.cabal @@ -16,7 +16,7 @@ library , bytestring , Cabal ^>=3.16.0.0 , Cabal-syntax ^>=3.16.0.0 - , QuickCheck >= 2.13.2 && < 2.17 + , QuickCheck >= 2.13.2 && < 2.18 exposed-modules: Test.QuickCheck.GenericArbitrary diff --git a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal index b9fb2fb99e8..eef88345deb 100644 --- a/cabal-install/cabal-install.cabal +++ b/cabal-install/cabal-install.cabal @@ -376,7 +376,7 @@ test-suite unit-tests , tasty-expected-failure , tasty-hunit >= 0.10 , tree-diff - , QuickCheck >= 2.14.3 && <2.17 + , QuickCheck >= 2.14.3 && <2.18 -- Tests to run with a limited stack and heap size -- The test suite name must be keep short cause a longer one @@ -465,5 +465,5 @@ test-suite long-tests , tasty-expected-failure , tasty-hunit >= 0.10 , tasty-quickcheck <0.12 - , QuickCheck >= 2.14 && <2.17 + , QuickCheck >= 2.14 && <2.18 , pretty-show >= 1.6.15