From 3d851b64b8b3f28851ddef5321fa497d43ffab2e Mon Sep 17 00:00:00 2001 From: Kyle Butt Date: Mon, 7 Nov 2022 10:36:50 -0700 Subject: [PATCH] haskell.compiler.ghc92*: backport Cabal bugfix for Paths_ modules There is a code generation bug in Cabal-3.6.3.0. For packages configured with --enable-relocatable, Cabal would generate code that doesn't compile. There isn't an upstream issue, but the issue is described in the commit that fixed it: https://github.com/haskell/cabal/commit/6c796218c92f93c95e94d5ec2d077f6956f68e98 It was fixed in Cabal-3.8.* Backport the fix to the Cabal library that ships with ghc-9.2.4 Co-authored-by: sternenseemann Closes #200063. --- pkgs/development/compilers/ghc/9.2.4.nix | 8 ++++++++ pkgs/development/compilers/ghc/9.2.5.nix | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/pkgs/development/compilers/ghc/9.2.4.nix b/pkgs/development/compilers/ghc/9.2.4.nix index cfbc403a3891..68657c9178a0 100644 --- a/pkgs/development/compilers/ghc/9.2.4.nix +++ b/pkgs/development/compilers/ghc/9.2.4.nix @@ -194,6 +194,14 @@ stdenv.mkDerivation (rec { extraPrefix = "utils/haddock/"; stripLen = 1; }) + # Don't generate code that doesn't compile when --enable-relocatable is passed to Setup.hs + # Can be removed if the Cabal library included with ghc backports the linked fix + (fetchpatch { + url = "https://github.com/haskell/cabal/commit/6c796218c92f93c95e94d5ec2d077f6956f68e98.patch"; + stripLen = 1; + extraPrefix = "libraries/Cabal/"; + sha256 = "sha256-yRQ6YmMiwBwiYseC5BsrEtDgFbWvst+maGgDtdD0vAY="; + }) ]; postPatch = "patchShebangs ."; diff --git a/pkgs/development/compilers/ghc/9.2.5.nix b/pkgs/development/compilers/ghc/9.2.5.nix index b7798ad044aa..12511c761391 100644 --- a/pkgs/development/compilers/ghc/9.2.5.nix +++ b/pkgs/development/compilers/ghc/9.2.5.nix @@ -194,6 +194,14 @@ stdenv.mkDerivation (rec { extraPrefix = "utils/haddock/"; stripLen = 1; }) + # Don't generate code that doesn't compile when --enable-relocatable is passed to Setup.hs + # Can be removed if the Cabal library included with ghc backports the linked fix + (fetchpatch { + url = "https://github.com/haskell/cabal/commit/6c796218c92f93c95e94d5ec2d077f6956f68e98.patch"; + stripLen = 1; + extraPrefix = "libraries/Cabal/"; + sha256 = "sha256-yRQ6YmMiwBwiYseC5BsrEtDgFbWvst+maGgDtdD0vAY="; + }) ]; postPatch = "patchShebangs .";