diff options
author | Timothy Sample <samplet@ngyro.com> | 2019-11-03 10:54:04 -0500 |
---|---|---|
committer | Timothy Sample <samplet@ngyro.com> | 2019-11-20 20:48:30 -0500 |
commit | faac56f3af797973c4a8400d841bbddc303e924b (patch) | |
tree | 7954bab1d46b1d942a712df7c12d8d1d1b41a8a0 | |
parent | 7fec7e66309b2d7f5d32ea74407465cf9d1e2f3b (diff) | |
download | patches-faac56f3af797973c4a8400d841bbddc303e924b.tar patches-faac56f3af797973c4a8400d841bbddc303e924b.tar.gz |
gnu: ghc-monad-par: Add a patch to fix tests on GHC 8.6.
* gnu/packages/patches/ghc-monad-par-fix-tests.patch: New file.
* gnu/local.mk: Add it.
* gnu/packages/haskell-xyz.scm (ghc-monad-par): Use it.
-rw-r--r-- | gnu/local.mk | 3 | ||||
-rw-r--r-- | gnu/packages/haskell-xyz.scm | 1 | ||||
-rw-r--r-- | gnu/packages/patches/ghc-monad-par-fix-tests.patch | 45 |
3 files changed, 48 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index a9548d4bd6..c6f0dfdb46 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -880,7 +880,8 @@ dist_patch_DATA = \ %D%/packages/patches/ghc-8.0-fall-back-to-madv_dontneed.patch \ %D%/packages/patches/ghc-diff-swap-cover-args.patch \ %D%/packages/patches/ghc-dont-pass-linker-flags-via-response-files.patch \ - %D%/packages/patches/ghc-haddock-library-unbundle.patch \ + %D%/packages/patches/ghc-haddock-library-unbundle.patch \ + %D%/packages/patches/ghc-monad-par-fix-tests.patch \ %D%/packages/patches/ghostscript-no-header-id.patch \ %D%/packages/patches/ghostscript-no-header-uuid.patch \ %D%/packages/patches/ghostscript-no-header-creationdate.patch \ diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm index 30d9098e1f..604c2deaa9 100644 --- a/gnu/packages/haskell-xyz.scm +++ b/gnu/packages/haskell-xyz.scm @@ -6541,6 +6541,7 @@ operators for looping.") (uri (string-append "https://hackage.haskell.org/package/" "monad-par-" version "/" "monad-par-" version ".tar.gz")) + (patches (search-patches "ghc-monad-par-fix-tests.patch")) (sha256 (base32 "0ldrzqy24fsszvn2a2nr77m2ih7xm0h9bgkjyv1l274aj18xyk7q")))) diff --git a/gnu/packages/patches/ghc-monad-par-fix-tests.patch b/gnu/packages/patches/ghc-monad-par-fix-tests.patch new file mode 100644 index 0000000000..d21a1e485c --- /dev/null +++ b/gnu/packages/patches/ghc-monad-par-fix-tests.patch @@ -0,0 +1,45 @@ +This patch is taken from upstream. It fixes a test to work with GHC 8.6. +The paths have been slightly altered to work with the release tarball. + +See <https://github.com/simonmar/monad-par/issues/66>. + +From e20f81c8060208e4fb038e8f0e0668b41d72a6fb Mon Sep 17 00:00:00 2001 +From: Clint Adams <clint@debian.org> +Date: Sat, 31 Aug 2019 14:12:34 -0400 +Subject: [PATCH] Use a case statement instead of pattern-matching in + case_test_diamond + +This avoids the need for a MonadFail instance. Closes #66 +--- + monad-par/tests/ParTests_shared.hs | 15 +++++++++------ + 1 file changed, 9 insertions(+), 6 deletions(-) + +diff --git a/tests/ParTests_shared.hs b/tests/ParTests_shared.hs +index 31f438d..b2de50c 100644 +--- a/tests/ParTests_shared.hs ++++ b/tests/ParTests_shared.hs +@@ -109,12 +109,15 @@ case_test_diamond :: Assertion + case_test_diamond = 9 @=? (m :: Int) + where + m = runPar $ do +- [a,b,c,d] <- sequence [new,new,new,new] +- fork $ do x <- get a; put b (x+1) +- fork $ do x <- get a; put c (x+2) +- fork $ do x <- get b; y <- get c; put d (x+y) +- fork $ do put a 3 +- get d ++ abcd <- sequence [new,new,new,new] ++ case abcd of ++ [a,b,c,d] -> do ++ fork $ do x <- get a; put b (x+1) ++ fork $ do x <- get a; put c (x+2) ++ fork $ do x <- get b; y <- get c; put d (x+y) ++ fork $ do put a 3 ++ get d ++ _ -> error "Oops" + + -- | Violate IVar single-assignment: + -- +-- +2.23.0 + |