Skip to content

Bump GHC to version 9.8.2#5123

Merged
paolino merged 15 commits into
masterfrom
paolino/ghc-9.8.2
Feb 12, 2026
Merged

Bump GHC to version 9.8.2#5123
paolino merged 15 commits into
masterfrom
paolino/ghc-9.8.2

Conversation

@paolino
Copy link
Copy Markdown
Collaborator

@paolino paolino commented Feb 9, 2026

Summary

  • Bump GHC from 9.6.6 to 9.8.2
  • Update dependencies for cardano-node 10.6.1 compatibility
  • Replace partial functions (head/tail) with safe alternatives
  • Migrate deprecated Cardano Ledger imports
  • Add DuplicateRecordFields extension where needed
  • Target 9.8.2 instead of 9.8.4 because haskell.nix's win-reloc-x86_64-pc64.patch (needed for Windows cross-compilation via iserv-proxy) is only applied for GHC < 9.8.3

Windows cross-compilation fixes

  • Force ghcOptions = ["-j1"] globally for Windows builds — iserv-proxy (the bridge between GHC on Linux and the interpreter running under Wine) does not support parallel module compilation; GHC's default -j4 causes multiple modules to share one iserv-proxy connection, corrupting the synchronous protocol and causing deadlocks (0% CPU hangs)
  • Strip {-# ANN #-} pragmas from fgl that trigger TH evaluation via iserv-proxy
  • Patch crypton-x509-system casing (Crypt32crypt32) and clear outdated haskell.nix patches for streaming-commons
  • Exclude benchmarks from the Windows test bundle
  • Fix ghc-lib-parser genSym.c atomic_inc64atomic_inc for dev shell tools

Supersedes #5093, #4930

@paolino paolino self-assigned this Feb 9, 2026
@paolino paolino force-pushed the paolino/ghc-9.8.2 branch 3 times, most recently from c384c6a to 15d7d08 Compare February 11, 2026 15:23
@paolino paolino added GHC Compiler bumps and removed ci:macos GHC Compiler bumps labels Feb 11, 2026
- Use error with descriptive messages instead of silently changing
  semantics (e.g. returning default values)
- Replace NE.!! with pattern matching in LayerSpec.hs
- Extract minPort/maxPort as top-level definitions to avoid repetition
- Use case pattern matching instead of tail/drop 1 to preserve crash
  semantics on impossible cases
- CheckpointsSpec: drop 1 → pattern match with error (not vacuous True)
- SequentialSpec/SharedSpec: BS.drop 1 → BS.uncons with error
- db-bench: restore error on empty range instead of silent "[]"
- RangeSpec: fromJust (also partial) → explicit pattern match
- TxSeq: restore infinite lists instead of truncating to 1001 elements
fgl's {-# ANN #-} pragmas trigger Template Haskell evaluation via
iserv-proxy which crashes during Windows cross-compilation.
Strip the HLint annotations (no functional impact) before building.
haskell.nix's win-reloc-x86_64-pc64.patch is only applied for
GHC < 9.8.3. Without it, iserv-proxy crashes during Windows
cross-compilation when evaluating Template Haskell.
The ghc-lib-parser 9.8.5.20250214 introduced a regression where
genSym.c calls atomic_inc64 which doesn't exist on the build
platform. This breaks the dev shell (fourmolu, hlint, etc).

Apply the same fix as upstream (digital-asset/ghc-lib#571):
replace atomic_inc64 with atomic_inc.
The overlay used --replace-fail which breaks when the nixpkgs
ghc-lib-parser (9.6.x) doesn't contain atomic_inc64. Guard the
substitution with a grep check.
The {-# ANN #-} pragmas in fgl trigger TH evaluation via iserv-proxy
under Wine, which crashes during Windows cross-compilation even with
GHC 9.8.2's win-reloc patch. Strip the HLint ANN lines (no functional
impact) during Windows builds only.
Remove benchmarks from the Windows testing bundle — JuicyPixels ANN
pragmas crash iserv-proxy during cross-compilation and benchmarks
aren't useful on Windows.

Fix ghc-lib-parser overlay to apply via haskellPackages.override
instead of haskell.packageOverrides which wasn't reaching the
nixpkgs haskell package set used by dev shell tools (fourmolu).
Move fourmolu/hlint/stylish-haskell from buildPackages.buildPackages
to pkgs.haskellPackages where the ghc-lib-parser overlay applies.
Add modules patch to HLS shell.tools for the GHC 9.8.2 build.
…eadlocks

iserv-proxy does not support parallel module compilation — the protocol
is strictly synchronous. GHC's default -j4 causes multiple modules to
share one iserv-proxy connection, corrupting the protocol and causing
deadlocks (0% CPU hangs). Force -j1 globally for Windows builds.
paolino added a commit that referenced this pull request Feb 12, 2026
## Summary

- Bump GHC from 9.8.2 to 9.10.1
- Widen text constraint to `>= 2.0 && < 2.2`
- Add `allow-newer: hkd:base`
- Add `allow-newer: cabal-fmt:base` for dev shell
- Update helper projects (rewrite-libs, set-git-rev) to ghc9101

Builds on #5123 (GHC 9.8.2 bump).
@paolino paolino merged commit 38768c1 into master Feb 12, 2026
59 checks passed
@paolino paolino deleted the paolino/ghc-9.8.2 branch February 12, 2026 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant