From 34e7e62588fad4cc2f612aa97606cae3fe7b0f14 Mon Sep 17 00:00:00 2001 From: Benjamin McRae Date: Wed, 25 Jun 2025 10:17:41 +0100 Subject: [PATCH 1/3] add paragraph mentioning stackage --- 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 d2db2d0a0ab428398e3b7c63e5ab80b98d19ae6d Mon Sep 17 00:00:00 2001 From: Benjamin McRae Date: Wed, 25 Jun 2025 17:25:21 +0100 Subject: [PATCH 2/3] add some discussion of import config limitations --- 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 0436a815862751b6205f8f756af80e7f174fe092 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 3/3] Update doc/nix-local-build.rst Co-authored-by: Phil de Joux --- 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 ============