From 07029deebba96c9cdab1729375ae26bfbf496c7f Mon Sep 17 00:00:00 2001 From: Reno Dakota Date: Tue, 12 Nov 2024 13:43:17 -0800 Subject: [PATCH] haskellPackages.hermes-json: fix vendored simdjson with clang-19 --- .../haskell-modules/configuration-common.nix | 33 +++++++++++++++++-- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index bd174babd549..c7f935d4288a 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2578,9 +2578,36 @@ self: super: { testTarget = "tests"; }) super.conduit-aeson; - # Upper bounds are too strict: - # https://github.com/velveteer/hermes/pull/22 - hermes-json = doJailbreak super.hermes-json; + hermes-json = overrideCabal (drv: { + # Upper bounds are too strict: + # https://github.com/velveteer/hermes/pull/22 + jailbreak = true; + + # vendored simdjson breaks with clang-19. apply patches that work with + # a more recent simdjson so we can un-vendor it + patches = drv.patches or [] ++ [ + (fetchpatch { + url = "https://github.com/velveteer/hermes/commit/6fd9904d93a5c001aadb27c114345a6958904d71.patch"; + hash = "sha256-Pv09XP0/VjUiAFp237Adj06PIZU21mQRh7guTlKksvA="; + excludes = [ + ".github/*" + "hermes-bench/*" + ]; + }) + (fetchpatch { + url = "https://github.com/velveteer/hermes/commit/ca8dddbf52f9d7788460a056fefeb241bcd09190.patch"; + hash = "sha256-tDDGS0QZ3YWe7+SP09wnxx6lIWL986ce5Zhqr7F2sBk="; + excludes = [ + "README.md" + ".github/*" + "hermes-bench/*" + ]; + }) + ]; + postPatch = drv.postPatch or "" + '' + ln -fs ${pkgs.simdjson.src} simdjson + ''; + }) super.hermes-json; # Disabling doctests. regex-tdfa = overrideCabal {