From ccce7c3bfb709378bb708336f660d5615f078041 Mon Sep 17 00:00:00 2001
From: Artem Pelenitsyn <a.pelenitsyn@gmail.com>
Date: Wed, 4 Oct 2023 09:36:12 -0400
Subject: [PATCH] doctest: provide a separate project file without -Werror (fix
 #9307)

This became necessary after an upgrade to GHC 9.4, which, apparently,
has a subtle change in how -W/-w-related things get interpreted.
---
 Makefile              |  4 ++--
 cabal.project.doctest | 24 ++++++++++++++++++++++++
 2 files changed, 26 insertions(+), 2 deletions(-)
 create mode 100644 cabal.project.doctest

diff --git a/Makefile b/Makefile
index 6d8394aa64..56747e4b9f 100644
--- a/Makefile
+++ b/Makefile
@@ -81,8 +81,8 @@ ghcid-cli :
 #       https://github.com/haskell/cabal/issues/8734
 #       Just as well, cabal-install(-solver) doctests (the target below) bitrotted and need some care.
 doctest :
-	cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.validate" Cabal-syntax
-	cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.validate" Cabal
+	cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.doctest" Cabal-syntax
+	cabal repl --with-ghc=doctest --build-depends=QuickCheck --build-depends=template-haskell --repl-options="-w" --project-file="cabal.project.doctest" Cabal
 
 
 # This is not run as part of validate.sh (we need hackage-security, which is tricky to get).
diff --git a/cabal.project.doctest b/cabal.project.doctest
new file mode 100644
index 0000000000..dac9b0d88a
--- /dev/null
+++ b/cabal.project.doctest
@@ -0,0 +1,24 @@
+packages: Cabal-syntax/
+packages: Cabal/
+packages: cabal-testsuite/
+packages: cabal-install/
+packages: solver-benchmarks/
+
+packages: cabal-install-solver/
+packages: Cabal-QuickCheck/
+packages: Cabal-tree-diff
+packages: Cabal-described
+packages: Cabal-tests
+packages: cabal-benchmarks
+
+tests: True
+
+-- avoiding extra dependencies
+constraints: rere -rere-cfg
+constraints: these -assoc
+
+write-ghc-environment-files: never
+
+program-options
+  ghc-options: -fno-ignore-asserts
+
-- 
GitLab