From 4ba7115786978c632868a6861496b7085c14ed94 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Wed, 8 Jan 2025 21:27:33 +0100 Subject: [PATCH] haskellPackages.lukko: fix ofd locking on 32bit Linux platforms Quoting the patch: > Previously, OFD locking was broken on 32-bit, because it would somehow > end up using the 64-bit fcntl() function, but pass it 32-bit off_t > values in struct flock. To fix this, tell libc to use always use > 64-bit file offsets. > > This is the same fix that was applied for a similar issue in GHC. --- .../haskell-modules/configuration-common.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 17dbb7db4895..a62b2f5bc784 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -351,6 +351,16 @@ self: super: { ghc-datasize = disableLibraryProfiling super.ghc-datasize; ghc-vis = disableLibraryProfiling super.ghc-vis; + # Fix 32bit struct being used for 64bit syscall on 32bit platforms + # https://github.com/haskellari/lukko/issues/15 + lukko = appendPatches [ + (fetchpatch { + name = "lukko-ofd-locking-32bit.patch"; + url = "https://github.com/haskellari/lukko/pull/32/commits/4e69ffad996c3771f50017b97375af249dd17c85.patch"; + sha256 = "0n8vig48irjz0jckc20dzc23k16fl5hznrc0a81y02ms72msfwi1"; + }) + ] super.lukko; + # Fixes compilation for basement on i686 for GHC >= 9.4 # https://github.com/haskell-foundation/foundation/pull/573 # Patch would not work for GHC >= 9.2 where it breaks compilation on x86_64