From ac31991cf1ec83ba495641ba7a83023f1adfd1ae Mon Sep 17 00:00:00 2001 From: Jake Keuhlen Date: Thu, 18 Jun 2026 15:46:04 -0600 Subject: [PATCH 1/2] ci: constrain megaparsec < 9.8 on GHC < 9.10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI builds recently started failing on GHC 8.8–9.8 with: Text/Megaparsec/Stream.hs:517:26: error: Variable not in scope: foldl' Failed to build megaparsec-9.8.0 megaparsec-9.8.0 uses an unqualified `foldl'`, which is only re-exported from Prelude as of base-4.20 (GHC 9.10). Because CI runs `cabal v2-freeze` fresh on every run (no committed freeze file), it floats to the newest Hackage release, and 9.8.0 fails to compile on every GHC below 9.10. Pin megaparsec < 9.8 for those compilers via a project conditional; GHC 9.10+ continue to use 9.8.0, which builds there without issue. Co-Authored-By: Claude Opus 4.8 (1M context) --- cabal.project | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cabal.project b/cabal.project index f1d679903..27b2de3d0 100644 --- a/cabal.project +++ b/cabal.project @@ -20,6 +20,12 @@ allow-newer: , bytestring-lexing:base , postgresql-simple-interval:persistent +-- megaparsec 9.8.0 uses an unqualified `foldl'`, which is only re-exported from +-- Prelude as of base-4.20 (GHC 9.10). On older GHCs it fails to compile with +-- "Variable not in scope: foldl'". Pin to < 9.8 there; newer GHCs build it fine. +if impl(ghc < 9.10) + constraints: megaparsec < 9.8 + source-repository-package type: git location: https://github.com/parsonsmatt/mysql From 1085cead15188dd6029c3480ef2ec5de1191fe05 Mon Sep 17 00:00:00 2001 From: Jake Keuhlen Date: Thu, 18 Jun 2026 16:06:32 -0600 Subject: [PATCH 2/2] ci: constrain megaparsec < 9.8 across all GHCs Broaden the previous GHC < 9.10 constraint to the whole matrix. megaparsec-9.8.0 breaks the build two different ways: * GHC < 9.10: fails to compile ("Variable not in scope: foldl'"), relying on foldl' being re-exported from Prelude (base-4.20 / GHC 9.10). * GHC >= 9.10: compiles, but changes parse-error rendering (the `^` caret under the offending token), breaking the expected strings in Database.Persist.Quasi's test suite (3 failures in QuasiSpec). The earlier conditional only fixed the compile error; pin unconditionally so every job uses the pre-9.8 error format the tests expect. Co-Authored-By: Claude Opus 4.8 (1M context) --- cabal.project | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/cabal.project b/cabal.project index 27b2de3d0..16e19b522 100644 --- a/cabal.project +++ b/cabal.project @@ -20,11 +20,15 @@ allow-newer: , bytestring-lexing:base , postgresql-simple-interval:persistent --- megaparsec 9.8.0 uses an unqualified `foldl'`, which is only re-exported from --- Prelude as of base-4.20 (GHC 9.10). On older GHCs it fails to compile with --- "Variable not in scope: foldl'". Pin to < 9.8 there; newer GHCs build it fine. -if impl(ghc < 9.10) - constraints: megaparsec < 9.8 +-- megaparsec 9.8.0 breaks the build in two ways: +-- * On GHC < 9.10 it fails to compile ("Variable not in scope: foldl'"), +-- because it relies on `foldl'` being re-exported from Prelude, which only +-- happens as of base-4.20 (GHC 9.10). +-- * On GHC >= 9.10 it compiles but changes how parse errors are rendered +-- (the `^` caret under the offending token), which breaks the expected +-- strings in Database.Persist.Quasi's test suite. +-- Pin to < 9.8 across the whole matrix until the suite is updated upstream. +constraints: megaparsec < 9.8 source-repository-package type: git