From 2e8fa702e3bba3d5630532614b91cecdfe7828ee Mon Sep 17 00:00:00 2001 From: sterni Date: Sat, 5 Sep 2026 13:31:51 +0200 Subject: [PATCH] haskellPackages.lzma-conduit: pick upstream patch to fix flaky failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Had to manually trim down the patch because filterdiff couldn't manage filtering out just the changes in tests/… --- .../haskell-modules/configuration-common.nix | 11 +++++++--- .../lzma-conduit-prevent-flaky-failures.patch | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 pkgs/development/haskell-modules/patches/lzma-conduit-prevent-flaky-failures.patch diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index bad4d40e0739..f411707c8e4a 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -909,9 +909,14 @@ with haskellLib; # 2022-01-29: Tests require package to be in ghc-db. aeson-schemas = dontCheck super.aeson-schemas; - # Too strict bounds on transformers and resourcet - # https://github.com/alphaHeavy/lzma-conduit/issues/23 krank:ignore-line - lzma-conduit = doJailbreak super.lzma-conduit; + lzma-conduit = lib.pipe super.lzma-conduit [ + # Too strict bounds on transformers and resourcet + # https://github.com/alphaHeavy/lzma-conduit/issues/23 krank:ignore-line + doJailbreak + # Forbid small inputs in test suite which fail an assertion + # https://github.com/alphaHeavy/lzma-conduit/issues/25 krank:ignore-line + (appendPatch ./patches/lzma-conduit-prevent-flaky-failures.patch) + ]; # 2020-06-05: HACK: does not pass own build suite - `dontCheck` # 2024-01-15: too strict bound on free < 5.2 diff --git a/pkgs/development/haskell-modules/patches/lzma-conduit-prevent-flaky-failures.patch b/pkgs/development/haskell-modules/patches/lzma-conduit-prevent-flaky-failures.patch new file mode 100644 index 000000000000..d1987c464258 --- /dev/null +++ b/pkgs/development/haskell-modules/patches/lzma-conduit-prevent-flaky-failures.patch @@ -0,0 +1,20 @@ +From f5a907574e3d77e1eb4768f4cc9807efcc753071 Mon Sep 17 00:00:00 2001 +From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> +Date: Thu, 2 Oct 2025 04:02:54 +0000 +Subject: [PATCH] Fix test failure for small inputs by adding precondition + +Co-authored-by: NathanHowell <170829+NathanHowell@users.noreply.github.com> +--- + +diff --git a/tests/Main.hs b/tests/Main.hs +index 140c942..7a69a72 100644 +--- a/tests/Main.hs ++++ b/tests/Main.hs +@@ -52,6 +52,7 @@ prop_compressAndDiscard = monadicIO . forAllM someBigString $ \ str -> do + + prop_compressAndCheckLength :: Property + prop_compressAndCheckLength = monadicIO . forAllM someBigString $ \ str -> do ++ pre $ B.length str > 64 + len <- run . runResourceT $ Cl.sourceList [str] C.$$ compress Nothing C.=$= Cl.fold (\ acc el -> acc + B.length el) 0 + -- random strings don't compress very well + assert (len > B.length str `div` 2) \ No newline at end of file