ci: constrain megaparsec < 9.8 on GHC < 9.10#1630
Open
jkeuhlen wants to merge 2 commits into
Open
Conversation
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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While trying to fix a CI issue in another PR (which came up on the actual functionality PR I was working on), I ran into this update to megaparsec which causes it to fail to build on older GHC versions. This pins the constraint for older versions so that everything can keep building.
Claude summary below, in case it's useful.
9.8 also causes test failures due to some other changes, so rather than a conditional fix I just pinned it below 9.8 everywhere:
Problem
CI builds recently began failing on every GHC below 9.10 (8.8 – 9.8) while compiling a transitive dependency:
megaparsec-9.8.0uses an unqualifiedfoldl', which is only re-exported fromPreludeas ofbase-4.20(GHC 9.10). On older compilers it's a hard "not in scope" compile error.It surfaced now because the workflow runs
cabal v2-freezefresh on every run (there's no committedcabal.project.freeze), so the solver always floats to the newest Hackage release — andmegaparsec-9.8.0was recently published. GHC 9.10/9.12 compile it fine; everything ≤ 9.8 breaks. This affectsmasterand every open PR equally, not any one branch.