From b83cc31f54b91bf432b3c286cc5022801317efc7 Mon Sep 17 00:00:00 2001 From: Fendor Date: Sat, 4 Nov 2023 13:38:49 +0100 Subject: [PATCH] Add dependencies used by `PackageTests` to exe:cabal-tests The runner allows the tests to use extra dependencies and the custom Prelude from 'cabal-testsuite'. However, if the tests use a dependency, say 'directory', and there are two packages with the same unit id available in the store, the test fails since it doesn't know which one to pick. By including an extra dependency to directory, we force the test runner to use a specific version directory, fixing the test failure. --- cabal-testsuite/cabal-testsuite.cabal | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index d4206163210..72221b316d5 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -101,6 +101,18 @@ executable cabal-tests , transformers -- dependencies specific to exe:cabal-tests , clock ^>= 0.7.2 || ^>=0.8 + -- Extra dependencies used by PackageTests. + -- + -- The runner allows the tests to use extra dependencies and the custom Prelude + -- from 'cabal-testsuite'. + -- However, if the tests use a dependency, say 'directory', and there are two + -- packages with the same unit id available in the store, the test fails since + -- it doesn't know which one to pick. + -- By including an extra dependency to directory, we force the test runner to + -- use a specific version directory, fixing the test failure. + -- + -- See issue description and discussion: https://github.com/haskell/cabal/issues/8356 + , directory build-tool-depends: cabal-testsuite:setup default-extensions: TypeOperators